Created
May 23, 2014 14:09
-
-
Save ntrepid8/2df548c5de9ba8e1ade1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'Unirest' | |
require 'json' | |
puts "testing" | |
begin | |
url = "http://stage.maasive.net/v2.4/5379f153b2c4271b06d88351/plays/" | |
parameters = { | |
:user_score=>5, | |
:alien_score=>1, | |
:match_length=>"01:00:15", | |
:country=>"USA", | |
:mobile_brand=>"Samsung", | |
:mobile_version=>"Galaxy S5"} | |
response = Unirest.post( | |
url, | |
headers:{ | |
"Accept" => "application/json", | |
"Content-Type" => "application/json" | |
}, | |
parameters:JSON.dump(parameters)) | |
data = response.body | |
log_content_response = "CODE: #{response.code} / BODY: #{response.body}" | |
rescue Exception => e | |
log_content_response = "Problems sending POST: #{e}" | |
end | |
puts log_content_response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment