Created
July 5, 2013 01:11
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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