るりまサーチ

最速Rubyリファレンスマニュアル検索!
330件ヒット [1-100件を表示] (0.129秒)

別のキーワード

  1. response new
  2. net/http response
  3. http get_response
  4. net/http get_response
  5. imap add_response_handler

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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...

絞り込み条件を変える

<< 1 2 3 ... > >>