るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.071秒)

別のキーワード

  1. cookie expires
  2. cookie expires=
  3. tuple expires
  4. cgi expires
  5. cgi expires=

ライブラリ

クラス

検索結果

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

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

...ンテンツの言語を指定します。Content-Language ヘッダに対応します。
: expires
送信するコンテンツの有効期限を Time のインスタンスで指定します。
Expires
ヘッダに対応します。
: cookie
クッキーとして文字列か CGI::Cookie のイ...
...字列で HTTP ヘッダを生成するための情報を指定します。

例:
header

# Content-Type: text/html

header
("text/plain")
# Content-Type: text/plain

header
({"nph" => true,
"status" => "OK", # == "200 OK"...
...age" => "ja",
"expires" => Time.now + 30,
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"})

例:
cgi = CGI.new('html3')
print cgi.header({"charset" => "shift_jis", "stat...

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

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

...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...