別のキーワード
クラス
-
Net
:: HTTP (209) -
Net
:: HTTPResponse (99) -
Net
:: IMAP :: ResponseError (11)
モジュール
-
Net
:: HTTPExceptions (11)
キーワード
- body (11)
-
close
_ on _ empty _ response= (11) - code (11)
- entity (11)
- get (22)
- get2 (22)
- head (11)
- head2 (22)
-
http
_ version (11) - msg (11)
- post (22)
- post2 (22)
-
read
_ body (22) -
request
_ get (22) -
request
_ head (22) -
request
_ post (22) - response (11)
-
send
_ request (11) - value (11)
検索結果
先頭5件
-
Net
:: IMAP :: ResponseError # response=(resp) (18101.0) -
エラーとなったレスポンスを表すオブジェクトを設定します。
エラーとなったレスポンスを表すオブジェクトを設定します。
@param resp 設定するレスポンスオブジェクト -
Net
:: HTTP # close _ on _ empty _ response=(bool) (6101.0) -
レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを設定します。
レスポンスがボディを持っていない場合にコネクションを
閉じるかどうかを設定します。
@param bool レスポンスがボディを持っていない場合にコネクションを
閉じるかどうか指定します。
@see Net::HTTP#close_on_empty_response -
Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse (13.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。
...。
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
:: HTTPResponse # value -> nil (13.0) -
レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。
...http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.value # => nil
//}
//emlist[例 レスポンスが 2xx以外][ruby]{
require 'net/http'
uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (7.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...のボディ] となります。
//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 (7.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...のボディ] となります。
//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 # get2(path , header = nil) -> Net :: HTTPResponse (7.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/i... -
Net
:: HTTP # get2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (7.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/i... -
Net
:: HTTP # head2(path , header = nil) -> Net :: HTTPResponse (7.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head... -
Net
:: HTTP # head2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (7.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
...文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
head2 は時代遅れなので使わないでください。
//emlist[例][ruby]{
response = http.request_head('/index.html')
p response['content-type']
//}
@see Net::HTTP#head...