るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. context prompt_n
  4. openssl n
  5. net/pop n_mails

種類

ライブラリ

クラス

キーワード

検索結果

net/http (26018.0)

汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。

...[ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}

//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}

//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require...
...e.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http.get('/index.html')
}
puts res.body
//}

//emlist[例4: 上の例よりさらに汎用的な例][ruby]{
require 'net/http'

url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HT...
....cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack', 'pass'
req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'})
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
else
res.value
end
//}

====...

Net::HTTPRedirection (24000.0)

HTTP レスポンス 3xx (Redirection) を表現するクラスです。

...HTTP レスポンス 3xx (Redirection) を表現するクラスです。

リクエストが正常に受信しましたが、処理を完了するためには
さらなる動作が必要なことを表します。...

Net::HTTPResponse::CODE_CLASS_TO_OBJ -> Hash (3006.0)

HTTP レスポンスステータスコードの最初の数字からレスポンスのクラス(分類)を あらわすクラスへのハッシュです。

...HTTP レスポンスステータスコードの最初の数字からレスポンスのクラス(分類)を
あらわすクラスへのハッシュです。

//emlist[][ruby]{
require 'net/http'
N
et::HTTPResponse::CODE_CLASS_TO_OBJ['3'] # => Net::HTTPRedirection
//}...