Skip to content

Instantly share code, notes, and snippets.

@nov
Created June 12, 2009 09:29
Show Gist options
  • Save nov/128538 to your computer and use it in GitHub Desktop.
Save nov/128538 to your computer and use it in GitHub Desktop.
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