4件ヒット
[1-4件を表示]
(0.063秒)
ライブラリ
-
net
/ http (4)
キーワード
- get (2)
- post (1)
-
read
_ timeout (1)
検索結果
先頭4件
-
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (18922.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......呼びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
Net::HTTPResponse オブジェクトは有効な body を
持ちません。
dest は時代遅れの引数です。利用しないでください。
dest.......html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (18922.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......呼びだされたときは
エンティティボディを少しずつ文字列として
ブロックに与えます。このとき戻り値の
Net::HTTPResponse オブジェクトは有効な body を
持ちません。
dest は時代遅れの引数です。利用しないでください。
dest.......html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # read _ timeout -> Integer|nil (18622.0) -
読みこみ(read(2)) 一回でブロックしてよい最大秒数 を返します。
...ックしてよい最大秒数
を返します。
この秒数たっても読みこめなければ例外 Net::ReadTimeout
を発生します。
nilはタイムアウトしないことを意味します。
デフォルトは 60 (秒)です。
@see Net::HTTP#open_timeout, Net::HTTP#read_timeout=... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (622.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え.......rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net::HTTP#request_post...