別のキーワード
クラス
-
Net
:: HTTP (228) -
Net
:: HTTPResponse (24) -
Net
:: IMAP :: ResponseError (12)
キーワード
-
close
_ on _ empty _ response= (12) - get (24)
- get2 (24)
- head (12)
- head2 (24)
- post (24)
- post2 (24)
-
read
_ body (24) -
request
_ get (24) -
request
_ head (24) -
request
_ post (24) -
send
_ request (12)
検索結果
先頭5件
- Net
:: IMAP :: ResponseError # response=(resp) - Net
:: HTTP # close _ on _ empty _ response=(bool) - Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse - Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse
-
Net
:: IMAP :: ResponseError # response=(resp) (18107.0) -
エラーとなったレスポンスを表すオブジェクトを設定します。
...エラーとなったレスポンスを表すオブジェクトを設定します。
@param resp 設定するレスポンスオブジェクト... -
Net
:: HTTP # close _ on _ empty _ response=(bool) (6107.0) -
レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを設定します。
...レスポンスがボディを持っていない場合にコネクションを
閉じるかどうかを設定します。
@param bool レスポンスがボディを持っていない場合にコネクションを
閉じるかどうか指定します。
@see Net::HTTP#close_on_empty_re... -
Net
:: HTTP # send _ request(name , path , data = nil , header = nil) -> Net :: HTTPResponse (31.0) -
HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。
...スタンスとして返します。
@param name リクエストのメソッド名を文字列で与えます。
@param path リクエストのパスを文字列で与えます。
@param data リクエストのボディを文字列で与えます。
@param header リクエストのヘッダをハ......ッシュで与えます。
//emlist[例][ruby]{
response = http.send_request('GET', '/index.html')
puts response.body
//}
@see Net::HTTP#request... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...順次
「dest << ボディの断片」を実行します。
@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの......のボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.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('s... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...順次
「dest << ボディの断片」を実行します。
@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの......のボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.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('s... -
Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。
...header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。
@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
1.1 互換モードの場......合は、レスポンスに応じて例外が発生します。
//emlist[例][ruby]{
require 'net/http'
response = nil
Net::HTTP.start('some.www.server', 80) {|http|
response = http.head('/index.html')
}
p response['content-type']
//}
@see Net::HTTP#request_head... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...取得して順次
「dest << ボディの断片」を実行します。
@param path POST先のパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの場合は......す。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.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', '... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...取得して順次
「dest << ボディの断片」を実行します。
@param path POST先のパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの場合は......す。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.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', '... -
Net
:: HTTP # post2(path , data , header = nil) -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...Content-Type として
"application/x-www-form-urlencoded" を用います。
@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデータを与えます。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
po...