7件ヒット
[1-7件を表示]
(0.024秒)
別のキーワード
クラス
キーワード
- []= (1)
- body= (1)
- chunked= (1)
-
content
_ length (1) -
content
_ length= (1) -
http
_ version (1)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # to _ s -> String (117325.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... -
WEBrick
:: HTTPResponse # []=(field , val) (63076.0) -
レスポンスの該当するヘッダに val を設定します。
...せん。
@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。
require 'time'
res['last-modified'] = Time.now.httpdate
@see WEBrick::HTTPResponse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type... -
WEBrick
:: HTTPResponse # chunked=(flag) (63040.0) -
真に設定するとクライアントに返す内容(エンティティボディ)を chunk に分けるようになります。
...す。
自身の WEBrick::HTTPResponse#request_http_version が 1.0 以下である場合、この値は無視されます。
@param flag true を指定した場合、レスポンスを chunk に分けてクライアントに返します。
require 'webrick'
include WEBrick
res = HTTPRespon... -
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (63040.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_version.to_s... -
WEBrick
:: HTTPResponse # body=(val) (63022.0) -
クライアントに返す内容(エンティティボディ)をセットします。
...ク形式にする必要はありません。
適切にチャンク形式エンコーディングされます。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connec... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (63022.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...まれません。
@param len ヘッダの値を整数で指定します。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... -
WEBrick
:: HTTPResponse # content _ length=(len) (63022.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...まれません。
@param len ヘッダの値を整数で指定します。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...