Skip to content

Instantly share code, notes, and snippets.

@thescouser89
Created July 5, 2013 01:11
Show Gist options
  • Save thescouser89/5931052 to your computer and use it in GitHub Desktop.
Save thescouser89/5931052 to your computer and use it in GitHub Desktop.
Simple file to submit a PUT request Test server 'RESTful' server is just a simple rails app.
require "net/http"
uri = URI.parse(URI.encode('http://127.0.0.1:3000'))
req = Net::HTTP::Put.new('/users/1/')
req.set_form_data('user[user]' => 'rocket')
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req)
end
puts res.code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment