Current File : //proc/thread-self/root/proc/self/root/opt/alt/ruby18/share/ri/1.8/system/CGI/out-i.yaml |
--- !ruby/object:RI::MethodDescription
aliases: []
block_params: ""
comment:
- !ruby/struct:SM::Flow::P
body: Print an HTTP header and body to $DEFAULT_OUTPUT ($>)
- !ruby/struct:SM::Flow::P
body: "The header is provided by <tt>options</tt>, as for #header(). The body of the document is that returned by the passed- in block. This block takes no arguments. It is required."
- !ruby/struct:SM::Flow::VERB
body: " cgi = CGI.new\n cgi.out{ "string" }\n # Content-Type: text/html\n # Content-Length: 6\n #\n # string\n\n cgi.out("text/plain") { "string" }\n # Content-Type: text/plain\n # Content-Length: 6\n #\n # string\n\n cgi.out("nph" => true,\n "status" => "OK", # == "200 OK"\n "server" => ENV['SERVER_SOFTWARE'],\n "connection" => "close",\n "type" => "text/html",\n "charset" => "iso-2022-jp",\n # Content-Type: text/html; charset=iso-2022-jp\n "language" => "ja",\n "expires" => Time.now + (3600 * 24 * 30),\n "cookie" => [cookie1, cookie2],\n "my_header1" => "my_value",\n "my_header2" => "my_value") { "string" }\n"
- !ruby/struct:SM::Flow::P
body: Content-Length is automatically calculated from the size of the String returned by the content block.
- !ruby/struct:SM::Flow::P
body: If ENV['REQUEST_METHOD'] == "HEAD", then only the header is outputted (the content block is still required, but it is ignored).
- !ruby/struct:SM::Flow::P
body: If the charset is "iso-2022-jp" or "euc-jp" or "shift_jis" then the content is converted to this charset, and the language is set to "ja".
full_name: CGI#out
is_singleton: false
name: out
params: (options = "text/html") {|| ...}
visibility: public