るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file ctime
  4. base file
  5. file size

クラス

キーワード

検索結果

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

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

...値を整数で指定します。nil を指定することは出来ません。

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

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

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

...値を整数で指定します。nil を指定することは出来ません。

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