Old dog, new tricks
Technical notes of a programmer living in the sunny city of Cebu
Wednesday, March 12, 2008
Posting binary data using ruby
data = File.read('sample.xml')
url = URI.parse('http://localhost:3000/update')
http = Net::HTTP.new(url.host, url.port)
response, body = http.post(url.path, data, {'Content-type'=>'text/xml;
charset=utf-8'})
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment