種類
- インスタンスメソッド (960)
- 特異メソッド (144)
- 文書 (36)
- ライブラリ (24)
- モジュール関数 (12)
ライブラリ
- ビルトイン (84)
-
cgi
/ core (24) -
cgi
/ html (24) -
cgi
/ util (12) -
net
/ http (396) -
net
/ imap (372) -
rdoc
/ context (12) -
rdoc
/ parser (12) -
rdoc
/ parser / c (12) -
rdoc
/ parser / ruby (12) -
rdoc
/ parser / simple (12) -
webrick
/ httpauth (12) -
webrick
/ httpproxy (12) -
webrick
/ httpresponse (48) -
webrick
/ httpservlet / abstract (72)
クラス
- CGI (36)
- Class (12)
- Data (6)
-
Net
:: HTTP (324) -
Net
:: HTTPGenericRequest (48) -
Net
:: HTTPResponse (24) -
Net
:: IMAP (12) -
Net
:: IMAP :: BodyTypeBasic (96) -
Net
:: IMAP :: BodyTypeMessage (96) -
Net
:: IMAP :: BodyTypeMultipart (60) -
Net
:: IMAP :: BodyTypeText (96) -
Net
:: IMAP :: FetchData (12) -
RDoc
:: Context :: Section (12) -
RDoc
:: Parser (12) -
RDoc
:: Parser :: C (12) -
RDoc
:: Parser :: Ruby (12) -
RDoc
:: Parser :: Simple (12) -
RubyVM
:: InstructionSequence (36) -
WEBrick
:: HTTPProxyServer (12) -
WEBrick
:: HTTPResponse (48) -
WEBrick
:: HTTPServlet :: AbstractServlet (72)
モジュール
-
CGI
:: HtmlExtension (24) -
RubyVM
:: AbstractSyntaxTree (30) -
WEBrick
:: HTTPAuth (12)
キーワード
- attr (12)
-
basic
_ auth (12) - body= (24)
-
body
_ stream (12) -
body
_ stream= (12) -
cgi
/ session (12) - chunked= (12)
-
content
_ id (36) -
content
_ length (12) -
content
_ length= (12) - define (6)
- description (36)
- disasm (12)
- disassemble (12)
- disposition (48)
-
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) - encoding (36)
- fetch (12)
- get (24)
- get2 (24)
- head2 (24)
- header (12)
- html (24)
- inherited (12)
-
local
_ host= (12) -
local
_ port= (12) - lock (12)
-
media
_ subtype (48) -
media
_ type (48) - mkcol (12)
- move (12)
-
net
/ http (12) - new (48)
- of (22)
- param (48)
- parse (10)
-
parse
_ file (10) -
parser
_ for (12) - patch (24)
- post (24)
- post2 (24)
- pretty (12)
- print (12)
- propfind (12)
- proppatch (12)
-
read
_ body (24) -
request
_ get (24) -
request
_ head (24) -
request
_ post (24) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
send
_ request (12) -
set
_ comment (12) - subtype (48)
- unlock (12)
- クラス/メソッドの定義 (12)
検索結果
先頭5件
-
Net
:: HTTPGenericRequest # body -> String (18125.0) -
サーバに送るリクエストのエンティティボディを返します。
...クエストのエンティティボディを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data"
req.body # => "Test Post Data"
//}
@see Net::HTTPGenericRequest#body=... -
Net
:: HTTPGenericRequest # body=(body) (6232.0) -
サーバに送るリクエストのエンティティボディを文字列で設定します。
...。
@param body 設定するボディを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data" # => "Test Post Data"
//}
@see Net::HTTPGenericRequest#body... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (6132.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 'net/http'
uri = URI.parse('htt......h/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
//}
一度ブロックを......い。
dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param dest obsoleteな引数です。利用しないでください。
@see Net::HTTP#request_get... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (6132.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 'net/http'
uri = URI.parse('htt......h/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
//}
一度ブロックを......い。
dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param dest obsoleteな引数です。利用しないでください。
@see Net::HTTP#request_get... -
Net
:: HTTPGenericRequest # body _ stream -> object (6120.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...を
IO オブジェクトなどのストリームで設定します。
f は read(size) メソッドが定義されている必要があります。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require 'net/http'......e.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f
post["Content-Length"] = f.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}... -
Net
:: HTTPGenericRequest # body _ stream=(f) (6120.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...を
IO オブジェクトなどのストリームで設定します。
f は read(size) メソッドが定義されている必要があります。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require 'net/http'......e.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f
post["Content-Length"] = f.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}... -
WEBrick
:: HTTPResponse # body=(val) (6119.0) -
クライアントに返す内容(エンティティボディ)をセットします。
...ライアントに返す内容(エンティティボディ)をセットします。
自身が chunked であっても body の値はチャンク形式ではありません。
@param val メッセージボディを文字列か 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-... -
Net
:: IMAP :: BodyTypeBasic # content _ id -> String | nil (3006.0) -
Content-ID の値を文字列で返します。
...Content-ID の値を文字列で返します。
@see 2045... -
Net
:: IMAP :: BodyTypeBasic # description -> String | nil (3006.0) -
Content-Description の値を文字列で返します。
...Content-Description の値を文字列で返します。
@see 2045...