We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Posted By

richardleonard on 12/31/69


Tagged

form textmate post rails ruby


Versions (?)


Who likes this?

9 people have marked this snippet as a favorite

daniel
sp00nyG
jpb
idiotkings
bbuckley
die_gabel
Phoenix
vali29
tkmr


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.