如何将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}