るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.011秒)
トップページ > クエリ:head[x] > ライブラリ:cgi/core[x]

別のキーワード

  1. http head2
  2. net/http head
  3. net/http head2
  4. http request_head
  5. net/http request_head

クラス

キーワード

検索結果

CGI#header(options = "text/html") -> String (6114.0)

HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。

...字列で HTTP ヘッダを生成するための情報を指定します。

例:
head
er
# Content-Type: text/html

head
er("text/plain")
# Content-Type: text/plain

head
er({"nph" => true,
"status" => "OK", # == "200 OK"...
...e1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})

例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "status" => "OK"})
print "<html><head><title>TITLE</title></head>\r\n"
print "<body>BODY</...

CGI#out(options = "text/html") { .... } (14.0)

HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

...HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

HEAD
リクエスト (REQUEST_METHOD == "HEAD") の場合は HTTP ヘッダのみを出力します。

charset が "iso-2022-jp"・"euc-jp"・"shift_jis" のいずれかで
ある場合は文字列エ...
...tml; charset=iso-2022-jp
"language" => "ja",
"expires" => Time.now + (3600 * 24 * 30),
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"}){ "string" }

@see CGI#header...