るりまサーチ

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

別のキーワード

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

検索結果

<< 1 2 3 > >>

Net::HTTPHeader#fetch(key) -> String (21187.0)

key ヘッダフィールドを返します。

...する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'

begin
req.fetch("content-length")
rescue =>...
.../http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP...
...::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader#[]...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (21187.0)

key ヘッダフィールドを返します。

...する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'

begin
req.fetch("content-length")
rescue =>...
.../http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP...
...::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader#[]...

Net::HTTPHeader#fetch(key, default) -> String (21187.0)

key ヘッダフィールドを返します。

...する][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}

//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'

begin
req.fetch("content-length")
rescue =>...
.../http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}

//emlist[例 key とブロックを指定][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP...
...::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}

@see Net::HTTPHeader#[]...

Gem::RemoteFetcher::FetchError (9016.0)

Gem::RemoteFetcher での処理で発生する IO や HTTP の例外をラップする例外クラスです。

...Gem::RemoteFetcher での処理で発生する IO や HTTP の例外をラップする例外クラスです。...

net/http (6316.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...
...oxy_port).start { |http|
# always proxy via your.proxy.addr:8080
}
//}

プロクシの認証をユーザ名とパスワードですることもできます。
詳しくは Net::HTTP.new を参照してください。


==== リダイレクトに対応する
以下の例の fetch はリダイレ...

絞り込み条件を変える

rubygems/commands/fetch_command (6018.0)

Gem パッケージをダウンロードしてカレントディレクトリに保存するためのライブラリです。

...Gem パッケージをダウンロードしてカレントディレクトリに保存するためのライブラリです。

Usage: gem fetch GEMNAME [GEMNAME ...] [options]
Options:
-v, --version VERSION 指定されたバージョンの Gem を取得します
--pl...
...Threshold for switching to bulk
synchronization (default 1000)
-p, --[no-]http-proxy [URL] リモートの操作に HTTP プロクシを使用します
--source URL Gem パッケージのリモートリポジトリの...

Gem::RemoteFetcher#request(uri, request_class, last_modified = nil) -> Net::HTTPResponse (3130.0)

与えられた URI に対してリクエストを実行し、Net::HTTPResponse を返します。

...てリクエストを実行し、Net::HTTPResponse を返します。

@param uri URI を指定します。

@param request_class Net::HTTP::Head か Net::HTTP::Get を指定します。

@param last_modified 最終更新時刻を指定します。

@see Net::HTTP, Net::HTTP::Head, Net::HTTP::Get...

Gem::RemoteFetcher#connection_for(uri) -> Net::HTTP (3117.0)

HTTP コネクションを生成して返します。

...
HTTP
コネクションを生成して返します。

既に接続している URI であれば、生成済みのコネクションを返します。
また、必要があればプロキシを使用します。

@param uri 接続先の URI を指定します。...

Gem::RemoteFetcher#reset(connection) -> Net::HTTP (3101.0)

与えられたコネクションをリセットします。

与えられたコネクションをリセットします。

@param connection コネクションを指定します。
<< 1 2 3 > >>