Skip to content

Instantly share code, notes, and snippets.

@rickychilcott
Last active August 29, 2015 14:19
Show Gist options
  • Save rickychilcott/eda952e4848f9e1043e5 to your computer and use it in GitHub Desktop.
Save rickychilcott/eda952e4848f9e1043e5 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'json'
SERVICE_LOC="http://173.230.142.215:3000"
ENDPOINT="#{SERVICE_LOC}/taste"
uri = URI(ENDPOINT)
taste = {
"beer_id" => 1,
"device_guid" => "ABCD124",
"age" => 28,
"lat" => "39.236",
"lon" => "-82.015",
}
req = Net::HTTP::Post.new(uri, initheader = {'Content-Type' =>'application/json'})
req.body = taste.to_json
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
puts http.request(req).body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment