33件ヒット
[1-33件を表示]
(0.061秒)
別のキーワード
ライブラリ
-
webrick
/ httpresponse (33)
キーワード
-
content
_ length (11) -
http
_ version (11)
検索結果
先頭3件
-
WEBrick
:: HTTPResponse # to _ s -> String (18214.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:
Conte... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (119.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは 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
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04... -
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (113.0) -
レスポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
...TTPVersion オブジェクトを返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
p res.http_version.class #=> WEBrick::HTTPVersion
p res.http_version.to_s #=> "1.1"...