如何将post参数传递给rest-open-uri?

时间:2012-12-28 17:37:19

标签: ruby http post

如何将post参数传递给Ruby中的函数rest-open-uri::open

我的代码是:

HEADER = {
  "User-Agent"     => "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1",
  "Accept-Charset" => "utf-8",
  "Accept"         => "text/html"
}

open("http://example.com/", HEADER).each {|s| my_html << s}

0 个答案:

没有答案