Posted By

richardleonard on 11/30/-1


Tagged

form textmate post rails ruby


Versions (?)

Who likes this?

16 people have marked this snippet as a favorite

daniel
sp00nyG
jpb
idiotkings
bbuckley
die_gabel
Phoenix
vali29
tkmr
javierjuarez
millisami
webstic
davidsi
bobbym245
kzelda
ringo380


Post form data


 / Published in: Ruby
 

  1. uri = URI.parse(url)
  2. req = Net::HTTP::Post.new(url)
  3. req.set_form_data({
  4. \'field\' => \'value\'
  5. })
  6. res = Net::HTTP.new(uri.host, uri.port).start { |http| http.request(req) }

Report this snippet  

You need to login to post a comment.