るりまサーチ

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

別のキーワード

  1. rss content=
  2. rss content
  3. net/imap content_id
  4. items content
  5. item content=

ライブラリ

クラス

キーワード

検索結果

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

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

...@param options Hash か文字列で HTTP ヘッダを生成するための情報を指定します。

例:
cgi = CGI.new
cgi.out{ "string" }
# Content-Type: text/html
# Content-Length: 6
#
# string

cgi.out("text/plain"){ "string"...
...}
# Content-Type: text/plain
# Content-Length: 6
#
# string

cgi.out({"nph" => true,
"status" => "OK", # == "200 OK"
"server" => ENV['SERVER_SOFTWARE'],
"connection" => "close",...
...# Content-Type: text/html; charset=iso-2022-jp
"language" => "ja",
"expires" => Time.now + (3600 * 24 * 30),
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"}){ "string...

IO#readpartial(maxlen, outbuf = "") -> String (232.0)

IO から長さ maxlen を上限として読み込み、文字列として返します。 即座に得られるデータが存在しないときにはブロックしてデータの到着を待ちます。 即座に得られるデータが 1byte でも存在すればブロックしません。

...ます。

例えば、パイプに対しては次のように動作します。

r, w = IO.pipe # buffer pipe content
w << "abc" # "" "abc".
r.readpartial(4096) #=> "abc" "" ""
r.readpartial(40...
...# バッファにもパイプにもデータがないのでブロックする

r, w = IO.pipe # buffer pipe content
w << "abc" # "" "abc"
w.close # "" "abc" EOF
r.readpar...
..." "" EOF
r.readpartial(4096) # 例外 EOFError 発生

r, w = IO.pipe # buffer pipe content
w << "abc\ndef\n" # "" "abc\ndef\n"
r.gets #=> "abc\n" "def\n" ""
w << "ghi...

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

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

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

ヘッダのキ...
...能です。

: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、...
...対応します。
: length
送信するコンテンツの長さを指定します。Content-Length ヘッダに対応します。
: language
送信するコンテンツの言語を指定します。Content-Language ヘッダに対応します。
: expires
送信するコンテンツの有効...