ライブラリ
-
net
/ http (11) -
net
/ imap (11) -
webrick
/ httpresponse (99) -
webrick
/ httpservlet / abstract (66)
クラス
-
Net
:: HTTPGenericRequest (11) -
Net
:: IMAP (11) -
WEBrick
:: HTTPResponse (99) -
WEBrick
:: HTTPServlet :: AbstractServlet (66)
キーワード
- body= (11)
- chunked= (11)
-
content
_ length (11) -
content
_ length= (11) -
do
_ DELETE (11) -
do
_ GET (11) -
do
_ HEAD (11) -
do
_ OPTIONS (11) -
do
_ POST (11) -
do
_ PUT (11) -
http
_ version (11) -
reason
_ phrase= (11) - rename (11)
-
response
_ body _ permitted? (11) - status= (11)
-
status
_ line (11) -
to
_ s (11)
検索結果
先頭5件
-
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (6126.0) -
サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。
...合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.response_body_permitted? # => true
head = Net::HTTP::Head.new(uri.request_uri)
head.response_body_permitted? # => false
//}... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (3013.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... -
WEBrick
:: HTTPResponse # content _ length=(len) (3013.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... -
WEBrick
:: HTTPResponse # body=(val) (3007.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... -
WEBrick
:: HTTPResponse # chunked=(flag) (3007.0) -
真に設定するとクライアントに返す内容(エンティティボディ)を chunk に分けるようになります。
...WEBrick::HTTPResponse#request_http_version が 1.0 以下である場合、この値は無視されます。
@param flag true を指定した場合、レスポンスを chunk に分けてクライアントに返します。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVer... -
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (3007.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_... -
WEBrick
:: HTTPResponse # reason _ phrase=(val) (3007.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) (3007.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 (3007.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 (3007.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...