516件ヒット
[1-100件を表示]
(0.117秒)
別のキーワード
ライブラリ
-
net
/ http (372) -
webrick
/ httpresponse (72) -
webrick
/ httpservlet / abstract (72)
クラス
-
Net
:: HTTP (300) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (48) -
WEBrick
:: HTTPResponse (72) -
WEBrick
:: HTTPServlet :: AbstractServlet (72)
キーワード
- body= (12)
-
body
_ exist? (12) - chunked= (12)
-
content
_ length (12) -
content
_ length= (12) -
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) - entity (12)
- get (24)
- get2 (24)
- head2 (24)
- lock (12)
- mkcol (12)
- move (12)
- patch (24)
- post (24)
- post2 (24)
- propfind (12)
- proppatch (12)
-
read
_ body (24) -
request
_ get (24) -
request
_ head (24) -
request
_ post (24) -
response
_ body _ permitted? (12) -
send
_ request (12) -
to
_ s (12) - unlock (12)
検索結果
先頭5件
-
Net
:: HTTPResponse # body -> String | () | nil (21132.0) -
エンティティボディを返します。
...エンティティボディを返します。
レスポンスにボディがない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないで......ください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
WEBrick
:: HTTPResponse # body -> String | IO (21108.0) -
クライアントに返す内容(エンティティボディ)を返します。
...クライアントに返す内容(エンティティボディ)を返します。
自身が chunked であっても body の値はチャンク形式ではありません。... -
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (12227.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
//}... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (9151.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...ロックを与えずに一度に結果取得][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require......n("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read_body do |s|
f.write(s)
end
end
end
end
//}
一度ブロッ... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (9151.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...ロックを与えずに一度に結果取得][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require......n("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read_body do |s|
f.write(s)
end
end
end
end
//}
一度ブロッ... -
WEBrick
:: HTTPResponse # body=(val) (9114.0) -
クライアントに返す内容(エンティティボディ)をセットします。
...クライアントに返す内容(エンティティボディ)をセットします。
自身が chunked であっても body の値はチャンク形式ではありません。
@param val メッセージボディを文字列か IO オブジェクトで指定します。
自身が chun......適切にチャンク形式エンコーディングされます。
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... -
Net
:: HTTPGenericRequest # body _ exist? -> bool (6114.0) -
このメソッドは obsolete です。
...このメソッドは obsolete です。
Net::HTTPGenericRequest#response_body_permitted?
の別名です。... -
Net
:: HTTPResponse # entity -> String | () | nil (6032.0) -
エンティティボディを返します。
...エンティティボディを返します。
レスポンスにボディがない場合には nil を返します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないで......ください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (3031.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...す。
: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実際のサイズとこの値が同じかどうかの検証は行われません。
: body が IO......します。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...