761件ヒット
[1-100件を表示]
(0.122秒)
別のキーワード
クラス
-
Net
:: HTTP (228) -
Net
:: HTTPGenericRequest (96) -
Net
:: HTTPRequest (12)
モジュール
-
Net
:: HTTPHeader (312)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - HTTPRequest (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) - OCSP (12)
- Proxy (12)
- [] (12)
- []= (12)
- address (12)
-
basic
_ auth (12) - body (12)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - chunked? (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type (12) -
content
_ type= (12) - delete (12)
- each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ key (12) -
each
_ name (12) -
each
_ value (12) - fetch (36)
-
form
_ data= (12) -
local
_ host= (12) -
local
_ port= (12) - method (24)
- path (12)
-
proxy
_ address (12) -
proxy
_ address= (12) -
proxy
_ basic _ auth (12) -
proxy
_ from _ env? (12) -
proxy
_ pass (12) -
proxy
_ pass= (12) -
proxy
_ port (12) -
proxy
_ port= (12) -
proxy
_ user (12) -
proxy
_ user= (12) - proxyaddr (12)
- proxyport (12)
- range (12)
-
range
_ length (12) -
request
_ body _ permitted? (12) -
response
_ body _ permitted? (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) -
set
_ content _ type (12) -
set
_ form _ data (12) -
ssl
_ version= (12) - start (24)
検索結果
先頭5件
- net
/ http - Net
:: HTTP . new(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil) -> Net :: HTTP - Net
:: HTTP . new(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil , no _ proxy=nil) -> Net :: HTTP - Net
:: HTTPRequest . new(path , initheader = nil) -> Net :: HTTPRequest - Net
:: HTTPHeader # fetch(key) -> String
-
net
/ http (38096.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...y]{
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 'ur......{
require 'net/http'
url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
puts res.body
//}
==== フォームの情報を送信する (POST)
//emlist[例][ruby]{
require 'net/http'
require '......制御する
url = URI.parse('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, Ne... -
Net
:: HTTP . new(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil) -> Net :: HTTP (26101.0) -
新しい Net::HTTP オブジェクトを生成します。
新しい Net::HTTP オブジェクトを生成します。
proxy_addr に :ENV を指定すると自動的に環境変数 http_proxy からプロクシの URI を
取り出し利用します。この場合環境変数 http_proxy が定義されていない場合には
プロクシは利用せず直接接続します。
詳しくは URI::Generic#find_proxy を参照してください。
明示的にプロクシのホスト名とポート番号を指定してプロクシを利用することもできます。
このときには proxy_addr にホスト名もしくは IP アドレスを渡します。
このときに proxy_userを指定するとプロク... -
Net
:: HTTP . new(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil , no _ proxy=nil) -> Net :: HTTP (26101.0) -
新しい Net::HTTP オブジェクトを生成します。
新しい Net::HTTP オブジェクトを生成します。
proxy_addr に :ENV を指定すると自動的に環境変数 http_proxy からプロクシの URI を
取り出し利用します。この場合環境変数 http_proxy が定義されていない場合には
プロクシは利用せず直接接続します。
詳しくは URI::Generic#find_proxy を参照してください。
明示的にプロクシのホスト名とポート番号を指定してプロクシを利用することもできます。
このときには proxy_addr にホスト名もしくは IP アドレスを渡します。
このときに proxy_userを指定するとプロク... -
Net
:: HTTPRequest . new(path , initheader = nil) -> Net :: HTTPRequest (26101.0) -
HTTP リクエストオブジェクトを生成します。
HTTP リクエストオブジェクトを生成します。
initheader でリクエストヘッダを指定することができます。
{ヘッダフィールド名(文字列)=>その中身(文字列)} という
Hash を用います。
@param path リクエストする path を文字列で与えます。
@param initheader リクエストヘッダをハッシュで指定します。 -
Net
:: HTTPHeader # fetch(key) -> String (8042.0) -
key ヘッダフィールドを返します。
...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......efault を指定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.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 (8042.0) -
key ヘッダフィールドを返します。
...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......efault を指定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.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 (8042.0) -
key ヘッダフィールドを返します。
...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......efault を指定][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", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length") { |e| 99 } # => 99
//}
@see Net::HTTPHeader#[]... -
Net
:: HTTP . Proxy(address , port = 80) -> Class (8024.0) -
Proxy 経由で http サーバに接続するためのクラスを作成し返します。
...TP.new を使う][ruby]{
require 'net/http'
proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080)
http = proxy_class.new('www.example.org')
http.start {|h|
h.get('/ja/') # proxy.example.com 経由で接続します。
}
//}
//emlist[例2: Net::HTTP.start を使う][ruby]{
require 'net/http'
p... -
Net
:: HTTPHeader # form _ data=(params) (8024.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse......('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.set_form_data({"q" => "ruby", "lang" => "en"}, ';') # => "application/x-www-form-urlencoded"
//}... -
Net
:: HTTPHeader # range -> Range|nil (8024.0) -
Range: ヘッダの示す範囲を Range オブジェクトで返します。
...ist[例 正常な値][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "bytes=1-5"
req.range # => [1..5]
//}
//emlist[例 Net::HTTPHeaderSyntaxError][ruby]{
require 'net/http'
uri = URI.parse('http://www.exampl......e.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "invalid"
req.range # => Net::HTTPHeaderSyntaxError
//}...