るりまサーチ

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

別のキーワード

  1. rss date
  2. rss date=
  3. date iso8601
  4. date rfc3339
  5. date jisx0301

キーワード

検索結果

<< < ... 22 23 24 >>

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

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

...'
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-Length: 2

ho...

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

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

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

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.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

hoge...
<< < ... 22 23 24 >>