るりまサーチ

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

別のキーワード

  1. net/http get
  2. http get
  3. http start
  4. net/http start
  5. net/http delete

種類

ライブラリ

クラス

キーワード

検索結果

Net::HTTPRedirection (24016.0)

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

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

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

net/http (6310.0)

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

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

=== 使用例

==== ウェブサーバからドキュメントを得る (GET)

//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/ind...
...uire 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}

//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'

url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http
.get('/in...
...arse('http://www.example.com/todo.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
# O...

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

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

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

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