Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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