種類
- インスタンスメソッド (99)
- 特異メソッド (11)
ライブラリ
-
webrick
/ httpresponse (110)
キーワード
- body= (11)
- chunked= (11)
-
content
_ length (11) -
content
_ length= (11) -
http
_ version (11) -
reason
_ phrase= (11) - status= (11)
-
status
_ line (11) -
to
_ s (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse . new(config) -> WEBrick :: HTTPResponse (18108.0) -
HTTPResponse オブジェクトを生成して返します。
...HTTPResponse オブジェクトを生成して返します。
@param config 設定を保存したハッシュを指定します。:HTTPVersion は必須です。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (13.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
Connection: Keep... -
WEBrick
:: HTTPResponse # content _ length=(len) (13.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
Connection: Keep... -
WEBrick
:: HTTPResponse # body=(val) (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... -
WEBrick
:: HTTPResponse # chunked=(flag) (7.0) -
真に設定するとクライアントに返す内容(エンティティボディ)を chunk に分けるようになります。
...身の WEBrick::HTTPResponse#request_http_version が 1.0 以下である場合、この値は無視されます。
@param flag true を指定した場合、レスポンスを chunk に分けてクライアントに返します。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :... -
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (7.0) -
レスポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
...スポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
p res.http_version.class #=> WEBrick::HTTPVersion
p res.http_versi... -
WEBrick
:: HTTPResponse # reason _ phrase=(val) (7.0) -
HTTP のレスポンスの最初の行の reason phrase をセットします。 この値が nil の場合 reason phrase は status から生成されます。 デフォルトは nil です。
...reason phrase は status から生成されます。
デフォルトは nil です。
@param val reason phrase を表す文字列を指定します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404
p res.reason_phrase #=> "Not Found"... -
WEBrick
:: HTTPResponse # status=(status) (7.0) -
レスポンスのステータスコードを整数で指定します。 reason_phrase も適切なものに設定されます。
...数で指定します。
reason_phrase も適切なものに設定されます。
@param status ステータスコードを整数で指定します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404
p res.reason_phrase #=> "Not Found"... -
WEBrick
:: HTTPResponse # status _ line -> String (7.0) -
HTTP のステータスラインを CR+LF 付き文字列で返します。
...HTTP のステータスラインを CR+LF 付き文字列で返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404
p res.status_line #=> "HTTP/1.1 404 Not Found \r\n"... -
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 Oc...