Skip to content

Instantly share code, notes, and snippets.

Created April 2, 2015 18:38
Show Gist options
  • Save anonymous/0ec2989f3dc8c86e2911 to your computer and use it in GitHub Desktop.
Save anonymous/0ec2989f3dc8c86e2911 to your computer and use it in GitHub Desktop.
params = {'param1' => 'info', 'param2' => 'more info'}
json_headers = {"Content-Type" => "application/json",
"Accept" => "application/json"}
uri = URI.parse('http://www.your-url.com/stuff')
http = Net::HTTP.new(uri.host, uri.port)
response = http.post(uri.path, params.to_json, json_headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment