132件ヒット
[1-100件を表示]
(0.089秒)
種類
- インスタンスメソッド (121)
- 特異メソッド (11)
ライブラリ
-
webrick
/ httpresponse (132)
キーワード
- body= (11)
- chunked= (11)
-
content
_ length (11) -
content
_ length= (11) -
http
_ version (11) - new (11)
-
reason
_ phrase= (11) -
request
_ http _ version (11) -
request
_ http _ version= (11) - status= (11)
-
status
_ line (11) -
to
_ s (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (6330.0) -
レスポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
...ージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
p res.http_version.class #=> WEBrick::HTTPVersion
p res.http_version.to_s... -
WEBrick
:: HTTPResponse # request _ http _ version -> WEBrick :: HTTPVersion (6302.0) -
リクエストの HTTP バージョンを返します。 デフォルトでは自身の WEBrick::HTTPResponse#http_version が使われます。
...リクエストの HTTP バージョンを返します。
デフォルトでは自身の WEBrick::HTTPResponse#http_version が使われます。... -
WEBrick
:: HTTPResponse # status _ line -> String (6207.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 # request _ http _ version=(ver) (6107.0) -
リクエストの HTTP バージョンをセットします。
...リクエストの HTTP バージョンをセットします。
@param ver リクエストの HTTP バージョンを WEBrick::HTTPVersion オブジェクトで指定します。... -
WEBrick
:: HTTPResponse . new(config) -> WEBrick :: HTTPResponse (3113.0) -
HTTPResponse オブジェクトを生成して返します。
...HTTPResponse オブジェクトを生成して返します。
@param config 設定を保存したハッシュを指定します。:HTTPVersion は必須です。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (3107.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...を整数で表すアクセサです。デフォルトは nil です。
: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実際のサイズとこの値が......れません。
: body が IO オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から 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
Dat... -
WEBrick
:: HTTPResponse # to _ s -> String (3107.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 # body=(val) (3007.0) -
クライアントに返す内容(エンティティボディ)をセットします。
... IO オブジェクトで指定します。
自身が chunked であってもチャンク形式にする必要はありません。
適切にチャンク形式エンコーディングされます。
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... -
WEBrick
:: HTTPResponse # chunked=(flag) (3007.0) -
真に設定するとクライアントに返す内容(エンティティボディ)を chunk に分けるようになります。
...す。
自身の WEBrick::HTTPResponse#request_http_version が 1.0 以下である場合、この値は無視されます。
@param flag true を指定した場合、レスポンスを chunk に分けてクライアントに返します。
require 'webrick'
include WEBrick
res = HTTPRespon......se.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
res.chunked = true
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 09:04:28 GMT
Server:
Transfer-Encoding: chunked
4
hoge
0
#... -
WEBrick
:: HTTPResponse # content _ length=(len) (3007.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...を整数で表すアクセサです。デフォルトは nil です。
: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実際のサイズとこの値が......れません。
: body が IO オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダはレスポンスに含まれず、IO から全てを読み込ん
でそれをエンティティボディとします。nil でないとき IO から 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
Dat...