るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.022秒)
トップページ > クエリ:File[x] > クエリ:IO[x] > クラス:WEBrick::HTTPResponse[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file size
  4. file open
  5. file path

ライブラリ

キーワード

検索結果

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

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

...れません。
: body が IO オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から content_length バ...
...require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.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-Le...

WEBrick::HTTPResponse#content_length=(len) (25.0)

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

...れません。
: body が IO オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から content_length バ...
...require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.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-Le...