るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.033秒)
トップページ > クエリ:v[x] > クラス:Net::HTTPResponse[x]

別のキーワード

  1. socket ai_v4mapped
  2. socket ipv6_v6only
  3. socket ai_v4mapped_cfg
  4. _builtin grep_v
  5. etc cs_v6_env

ライブラリ

キーワード

検索結果

Net::HTTPResponse#http_version -> String (6101.0)

サーバがサポートしている HTTP のバージョンを文字列で返します。

...サーバがサポートしている HTTP のバージョンを文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}...

Net::HTTPResponse#value -> nil (6101.0)

レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。

...スポンスである場合に発生します。
@raise HTTPRetriableError レスポンスが 3xx である場合に発生します。
@raise HTTPServerException レスポンスが 4xx である場合に発生します。
@raise HTTPFatalError レスポンスが 5xx である場合に発生します...
...e(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
response.value
rescue => e
e.class # => Net::HTTPServerException
e.message #...