Skip to content

Instantly share code, notes, and snippets.

@nwb
Created January 14, 2010 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwb/277555 to your computer and use it in GitHub Desktop.
Save nwb/277555 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'uri'
require 'rubygems'
require 'json'
require 'pp'
url = URI.parse('http://localhost:3000/api/shipments/2145203996')
req = Net::HTTP::Get.new(url.path)
req["Content-Type"] = 'application/json'
req["Accept"] = 'application/json'
req["X-SpreeAPIKey"] = '.....'
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
pp JSON.parse(res.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment