Skip to content

Instantly share code, notes, and snippets.

@nov

nov/gist:128538

Created Jun 12, 2009
Embed
What would you like to do?
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
You can’t perform that action at this time.