るりまサーチ

最速Rubyリファレンスマニュアル検索!
120件ヒット [1-100件を表示] (0.114秒)
トップページ > クエリ:r[x] > クエリ:string[x] > 種類:インスタンスメソッド[x] > クラス:WEBrick::HTTPResponse[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

キーワード

検索結果

<< 1 2 > >>

WEBrick::HTTPResponse#reason_phrase -> String | nil (6203.0)

HTTP のレスポンスの最初の行の reason phrase を返します。 この値が nil の場合 reason phrase は status から生成されます。 デフォルトは nil です。

...HTTP のレスポンスの最初の行の reason phrase を返します。
この値が nil の場合 reason phrase は status から生成されます。
デフォルトは nil です。...

WEBrick::HTTPResponse#request_method -> String | nil (6203.0)

リクエストの HTTP メソッドを返します。

リクエストの HTTP メソッドを返します。

WEBrick::HTTPResponse#status_line -> String (3209.0)

HTTP のステータスラインを CR+LF 付き文字列で返します。

...HTTP のステータスラインを CR+LF 付き文字列で返します。

r
equire 'webrick'
r
es = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
r
es.status = 404

p res.status_line #=> "HTTP/1.1 404 Not Found \r\n"...

WEBrick::HTTPResponse#[](field) -> String (3203.0)

レスポンスのヘッダの該当する内容を文字列で返します。

...レスポンスのヘッダの該当する内容を文字列で返します。

@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。

p res['date'] #=> "Sat, 27 Oct 2007 08:53:03 GMT"...

WEBrick::HTTPResponse#body -> String | IO (3203.0)

クライアントに返す内容(エンティティボディ)を返します。

クライアントに返す内容(エンティティボディ)を返します。

自身が chunked であっても body の値はチャンク形式ではありません。

絞り込み条件を変える

WEBrick::HTTPResponse#content_type -> String | nil (3203.0)

Content-Type ヘッダの値を返します。

Content-Type ヘッダの値を返します。

WEBrick::HTTPResponse#filename -> String | nil (3203.0)

自身の内容があるファイルのそれである場合に、そのファイル名を返します。 デフォルトは nil です。

自身の内容があるファイルのそれである場合に、そのファイル名を返します。
デフォルトは nil です。

WEBrick::HTTPResponse#to_s -> String (3203.0)

実際にクライアントに送られるデータを文字列として返します。

...字列として返します。

r
equire 'webrick'
include WEBrick
r
es = HTTPResponse.new( { :HTTPVersion => "1.1" } )
r
es.body = 'hoge'
print res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Length: 4

hog...

WEBrick::HTTPResponse#content_length -> Integer | nil (3108.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...せん。

@param len ヘッダの値を整数で指定します。nil を指定することは出来ません。

r
equire 'webrick'
include WEBrick
r
es = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
r
es.body = f
r
es.content_length = 2
print res.to_s

#=>...
...出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Server:
Content-Length: 2

ho...
<< 1 2 > >>