1354件ヒット
[1-100件を表示]
(0.033秒)
種類
- インスタンスメソッド (1090)
- 特異メソッド (264)
キーワード
- Proxy (11)
- active? (11)
- address (11)
-
ca
_ file (11) -
ca
_ file= (11) -
ca
_ path (11) -
ca
_ path= (11) - cert (11)
- cert= (11)
-
cert
_ store (11) -
cert
_ store= (11) - ciphers (11)
- ciphers= (11)
-
close
_ on _ empty _ response (11) -
close
_ on _ empty _ response= (11) -
continue
_ timeout (11) -
continue
_ timeout= (11) - copy (11)
-
default
_ port (11) - delete (11)
- finish (11)
- get (44)
- get2 (22)
-
get
_ print (22) -
get
_ response (22) - head (11)
- head2 (22)
-
http
_ default _ port (11) -
https
_ default _ port (11) -
is
_ version _ 1 _ 1? (11) -
is
_ version _ 1 _ 2? (11) -
keep
_ alive _ timeout (11) -
keep
_ alive _ timeout= (11) - key (11)
- key= (11)
-
local
_ host (11) -
local
_ host= (11) -
local
_ port (11) -
local
_ port= (11) - lock (11)
- mkcol (11)
- move (11)
- new (11)
-
open
_ timeout (11) -
open
_ timeout= (11) - patch (22)
-
peer
_ cert (11) - port (11)
- post (22)
- post2 (22)
-
post
_ form (11) - propfind (11)
- proppatch (11)
- proxy? (11)
-
proxy
_ address (22) -
proxy
_ address= (11) -
proxy
_ class? (11) -
proxy
_ from _ env= (11) -
proxy
_ from _ env? (11) -
proxy
_ pass (22) -
proxy
_ pass= (11) -
proxy
_ port (22) -
proxy
_ port= (11) -
proxy
_ uri (11) -
proxy
_ user (22) -
proxy
_ user= (11) - proxyaddr (11)
- proxyport (11)
- put (11)
- put2 (22)
-
read
_ timeout (11) -
read
_ timeout= (11) - request (22)
-
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
request
_ put (22) -
send
_ request (11) -
set
_ debug _ output (11) -
ssl
_ timeout (11) -
ssl
_ timeout= (11) -
ssl
_ version (11) -
ssl
_ version= (11) - start (44)
- started? (11)
- trace (11)
- unlock (11)
-
use
_ ssl= (11) -
use
_ ssl? (11) -
verify
_ callback (11) -
verify
_ callback= (11) -
verify
_ depth (11) -
verify
_ depth= (11) -
verify
_ mode (11) -
verify
_ mode= (11) -
version
_ 1 _ 1? (11) -
version
_ 1 _ 2 (11) -
version
_ 1 _ 2? (11) -
write
_ timeout (6) -
write
_ timeout= (6)
検索結果
先頭5件
-
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (8015.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html'......)
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (8015.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html'......)
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP . Proxy(address , port = 80) -> Class (8015.0) -
Proxy 経由で http サーバに接続するためのクラスを作成し返します。
...ラスは Net::HTTP を継承しているので Net::HTTP と全く
同じように使えます。指定されたプロクシを常に経由して http サーバ
に接続します。
address が nil のときは Net::HTTP クラスをそのまま返します。
//emlist[例1: Net::HTTP.new を使......uire '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'
proxy_class = Net::HTTP::Prox... -
Net
:: HTTP . get _ print(host , path , port = 80) -> () (8015.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...ポートを整数で指定します。
@see Net::HTTP.get
=== 例
//emlist[][ruby]{
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
//}
もしくは
//emlist[][ruby]{
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'
//}... -
Net
:: HTTP . get _ print(uri) -> () (8015.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...ポートを整数で指定します。
@see Net::HTTP.get
=== 例
//emlist[][ruby]{
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
//}
もしくは
//emlist[][ruby]{
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'
//}... -
Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse (8009.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。
...サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse のインスタンスを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*......。
1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
//emlist[例][ruby]{
require 'net/http'
response = nil
Net::HTTP.start('some.www.server', 80) {|http|
response = http.head('/index.html')
}
p response['content-type']
//}
@see Net::HTTP#request_head... -
Net
:: HTTP # local _ host=(host) (8009.0) -
接続に用いるローカルホスト名を指定します。
...ost ホスト名、もしくはアドレスを示す文字列
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_host=, Net::HTTP#local_port... -
Net
:: HTTP # local _ port=(port) (8009.0) -
接続に用いるローカルポートを設定します。
...、もしくはサービス名文字列)
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_port=, Net::HTTP#local_host
@see Net::HTTP.new... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (8009.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え......例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb......', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net::HTTP#request_post... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (8009.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。
返り値は Net::HTTPResponse のインスタンスです。
ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え......例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb......', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write str
end
}
//}
@see Net::HTTP#request_post...