require 'net/http' | |
require 'rubygems' | |
require 'json' | |
params = { | |
:context => { | |
:country => 'ALL', | |
:language => 'ja' | |
}, | |
:gadgets => [{ | |
:url => 'http://matake.jp/smartfm/index.xml', | |
:moduleId => 1 | |
}] | |
} | |
Net::HTTP.version_1_2 | |
req = Net::HTTP::Post.new('/gadgets/metadata') | |
req.body = params.to_json | |
puts req.body | |
Net::HTTP.start('localhost', 8080) {|http| | |
res = http.request(req) | |
puts "--RESULT--" | |
puts res.inspect, res.body | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment