204件ヒット
[1-100件を表示]
(0.023秒)
種類
- インスタンスメソッド (108)
- 文書 (42)
- ライブラリ (36)
- クラス (12)
- 特異メソッド (6)
ライブラリ
- ビルトイン (6)
-
net
/ http (36) -
rubygems
/ remote _ fetcher (84)
クラス
- Data (6)
-
Gem
:: RemoteFetcher (72)
モジュール
-
Net
:: HTTPHeader (36)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - FetchError (12)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 5 . 0 (8) -
connection
_ for (12) - define (6)
-
get
_ proxy _ from _ env (12) -
net
/ http (12) -
net
/ imap (12) -
normalize
_ uri (12) -
open
_ uri _ or _ path (12) - request (12)
- reset (12)
-
rubygems
/ commands / fetch _ command (12)
検索結果
先頭5件
-
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 コネクションを指定します。