Skip to content

Instantly share code, notes, and snippets.

@vlad-shatskyi
Created March 30, 2013 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlad-shatskyi/5276412 to your computer and use it in GitHub Desktop.
Save vlad-shatskyi/5276412 to your computer and use it in GitHub Desktop.
mechanize
require 'mechanize'
require 'json'
agent = Mechanize.new
headers = {
'X-Requested-With' => 'XMLHttpRequest',
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => '*/*',
'Cookie' => 'removed'
}
params = {
start: 0,
limit: 19,
sort: 'last_activity',
dir: 'desc',
filters: [{
field: 'account',
comparison: 'eq',
value: 'something'
}]
}.to_json
page = agent.post('https://top-secret-url', params, headers)
puts page.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment