種類
- インスタンスメソッド (163)
- クラス (101)
- 特異メソッド (26)
- モジュール (2)
- 定数 (2)
クラス
-
Net
:: HTTP (124) -
Net
:: HTTPGenericRequest (9) -
Net
:: HTTPRequest (1) -
Net
:: HTTPResponse (15)
モジュール
-
Net
:: HTTPExceptions (1) -
Net
:: HTTPHeader (41)
キーワード
-
CODE
_ CLASS _ TO _ OBJ (1) -
CODE
_ TO _ OBJ (1) - Copy (1)
- Delete (1)
- Get (1)
- HTTP (1)
- HTTPAccepted (1)
- HTTPAlreadyReported (1)
- HTTPBadGateway (1)
- HTTPBadRequest (1)
- HTTPBadResponse (1)
- HTTPClientError (1)
- HTTPClientException (1)
- HTTPConflict (1)
- HTTPContinue (1)
- HTTPCreated (1)
- HTTPEarlyHints (1)
- HTTPError (1)
- HTTPExceptions (1)
- HTTPExpectationFailed (1)
- HTTPFailedDependency (1)
- HTTPFatalError (1)
- HTTPForbidden (1)
- HTTPFound (1)
- HTTPGatewayTimeOut (1)
- HTTPGatewayTimeout (1)
- HTTPGenericRequest (1)
- HTTPGone (1)
- HTTPHeader (1)
- HTTPHeaderSyntaxError (1)
- HTTPIMUsed (1)
- HTTPInformation (1)
- HTTPInsufficientStorage (1)
- HTTPInternalServerError (1)
- HTTPLengthRequired (1)
- HTTPLocked (1)
- HTTPLoopDetected (1)
- HTTPMethodNotAllowed (1)
- HTTPMisdirectedRequest (1)
- HTTPMovedPermanently (1)
- HTTPMovedTemporarily (1)
- HTTPMultiStatus (1)
- HTTPMultipleChoice (1)
- HTTPMultipleChoices (1)
- HTTPNetworkAuthenticationRequired (1)
- HTTPNoContent (1)
- HTTPNonAuthoritativeInformation (1)
- HTTPNotAcceptable (1)
- HTTPNotExtended (1)
- HTTPNotFound (1)
- HTTPNotImplemented (1)
- HTTPNotModified (1)
- HTTPOK (1)
- HTTPPartialContent (1)
- HTTPPayloadTooLarge (1)
- HTTPPaymentRequired (1)
- HTTPPermanentRedirect (1)
- HTTPPreconditionFailed (1)
- HTTPPreconditionRequired (1)
- HTTPProcessing (1)
- HTTPProxyAuthenticationRequired (1)
- HTTPRangeNotSatisfiable (1)
- HTTPRedirection (1)
- HTTPRequest (1)
- HTTPRequestEntityTooLarge (1)
- HTTPRequestHeaderFieldsTooLarge (1)
- HTTPRequestTimeOut (1)
- HTTPRequestTimeout (1)
- HTTPRequestURITooLarge (1)
- HTTPRequestURITooLong (1)
- HTTPRequestedRangeNotSatisfiable (1)
- HTTPResetContent (1)
- HTTPResponse (1)
- HTTPRetriableError (1)
- HTTPSeeOther (1)
- HTTPServerError (1)
- HTTPServerException (1)
- HTTPServiceUnavailable (1)
- HTTPSession (1)
- HTTPSuccess (1)
- HTTPSwitchProtocol (1)
- HTTPTemporaryRedirect (1)
- HTTPTooManyRequests (1)
- HTTPURITooLong (1)
- HTTPUnavailableForLegalReasons (1)
- HTTPUnknownResponse (1)
- HTTPUnprocessableEntity (1)
- HTTPUnsupportedMediaType (1)
- HTTPUpgradeRequired (1)
- HTTPUseProxy (1)
- HTTPVariantAlsoNegotiates (1)
- HTTPVersionNotSupported (1)
- Head (1)
- Lock (1)
- Mkcol (1)
- Move (1)
- Options (1)
- Patch (1)
- Post (1)
- Propfind (1)
- Proppatch (1)
- Proxy (1)
- Put (1)
- Trace (1)
- Unlock (1)
- [] (1)
- []= (1)
- active? (1)
-
add
_ field (1) - address (1)
-
basic
_ auth (1) - body (2)
- body= (1)
-
body
_ exist? (1) -
body
_ permitted? (1) -
body
_ stream (1) -
body
_ stream= (1) -
ca
_ file (1) -
ca
_ file= (1) -
ca
_ path (1) -
ca
_ path= (1) -
canonical
_ each (1) - cert (1)
- cert= (1)
-
cert
_ store (1) -
cert
_ store= (1) - chunked? (1)
- ciphers (1)
- ciphers= (1)
-
close
_ on _ empty _ response (1) -
close
_ on _ empty _ response= (1) - code (1)
-
content
_ length (1) -
content
_ length= (1) -
content
_ range (1) -
content
_ type (1) -
content
_ type= (1) -
continue
_ timeout (1) -
continue
_ timeout= (1) - copy (1)
-
default
_ port (1) - delete (2)
- each (1)
-
each
_ capitalized (1) -
each
_ capitalized _ name (1) -
each
_ header (1) -
each
_ key (1) -
each
_ name (1) -
each
_ value (1) - entity (1)
- fetch (3)
- finish (1)
-
form
_ data= (1) - get (4)
- get2 (2)
-
get
_ fields (1) -
get
_ print (2) -
get
_ response (2) - head (1)
- head2 (2)
- header (1)
-
http
_ default _ port (1) -
http
_ version (1) -
https
_ default _ port (1) -
is
_ version _ 1 _ 1? (1) -
is
_ version _ 1 _ 2? (1) -
keep
_ alive _ timeout (1) -
keep
_ alive _ timeout= (1) - key (1)
- key= (1)
- key? (1)
- length (1)
-
local
_ host (1) -
local
_ host= (1) -
local
_ port (1) -
local
_ port= (1) - lock (1)
-
main
_ type (1) - method (2)
- mkcol (1)
- move (1)
- msg (1)
- new (2)
-
open
_ timeout (1) -
open
_ timeout= (1) - patch (2)
- path (1)
-
peer
_ cert (1) - port (1)
- post (2)
- post2 (2)
-
post
_ form (1) - propfind (1)
- proppatch (1)
- proxy? (1)
-
proxy
_ address (2) -
proxy
_ address= (1) -
proxy
_ basic _ auth (1) -
proxy
_ class? (1) -
proxy
_ from _ env= (1) -
proxy
_ from _ env? (1) -
proxy
_ pass (2) -
proxy
_ pass= (1) -
proxy
_ port (2) -
proxy
_ port= (1) -
proxy
_ uri (1) -
proxy
_ user (2) -
proxy
_ user= (1) - proxyaddr (1)
- proxyport (1)
- put (1)
- put2 (2)
- range (1)
- range= (2)
-
range
_ length (1) -
read
_ body (2) -
read
_ timeout (1) -
read
_ timeout= (1) -
reader
_ header (1) - request (2)
-
request
_ body _ permitted? (1) -
request
_ get (2) -
request
_ head (2) -
request
_ post (2) -
request
_ put (2) - response (2)
-
response
_ body _ permitted? (1) -
send
_ request (1) -
set
_ content _ type (1) -
set
_ debug _ output (1) -
set
_ form _ data (1) -
set
_ range (3) - size (1)
-
ssl
_ timeout (1) -
ssl
_ timeout= (1) -
ssl
_ version (1) -
ssl
_ version= (1) - start (4)
- started? (1)
-
sub
_ type (1) - trace (1)
-
type
_ params (1) - unlock (1)
-
use
_ ssl= (1) -
use
_ ssl? (1) - value (1)
-
verify
_ callback (1) -
verify
_ callback= (1) -
verify
_ depth (1) -
verify
_ depth= (1) -
verify
_ mode (1) -
verify
_ mode= (1) -
version
_ 1 _ 1? (1) -
version
_ 1 _ 2 (1) -
version
_ 1 _ 2? (1) -
write
_ timeout (1) -
write
_ timeout= (1)
検索結果
先頭5件
-
Net
:: HTTPHeader # fetch(key) -> String (24079.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... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (24079.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... -
Net
:: HTTPHeader # fetch(key , default) -> String (24079.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... -
Net
:: HTTPResponse # value -> nil (24061.0) -
レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。
...スが 2xx(成功)でなかった場合に、対応する
例外を発生させます。
@raise HTTPError レスポンスが 1xx であるか、 net/http が知らない
種類のレスポンスである場合に発生します。
@raise HTTPRetriableError レスポンスが 3xx......レスポンスが 2xx(成功)][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.value # => nil
//}
//emlist[例 レスポンスが 2xx以外][ruby]{
require 'net/http'
uri = "http://www.example.com/invalid.html"
respo... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (24043.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...、返り値が [レスポンスオブジェクト, そのボディ] となります。
//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'... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (24043.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...、返り値が [レスポンスオブジェクト, そのボディ] となります。
//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'... -
Net
:: HTTP . Proxy(address , port = 80) -> Class (24043.0) -
Proxy 経由で http サーバに接続するためのクラスを作成し返します。
...][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'
proxy_class = Net... -
Net
:: HTTP . get _ print(host , path , port = 80) -> () (24043.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) -> () (24043.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
:: HTTPHeader # form _ data=(params) (24043.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... -
Net
:: HTTPHeader # range -> Range|nil (24043.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... -
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (24043.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... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (24043.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...果取得][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'
uri = URI.parse('http:/... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (24043.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...果取得][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'
uri = URI.parse('http:/... -
Net
:: HTTP # head(path , header = nil) -> Net :: HTTPResponse (24025.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse のインスタンスを返します。
...ュで指定します。
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:... -
Net
:: HTTP # local _ host=(host) (24025.0) -
接続に用いるローカルホスト名を指定します。
...ます。
デフォルトは nil です。
@param host ホスト名、もしくはアドレスを示す文字列
//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
//... -
Net
:: HTTP # local _ port=(port) (24025.0) -
接続に用いるローカルポートを設定します。
...デフォルトは nil です。
@param port ローカルポート(数値、もしくはサービス名文字列)
//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
//... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (24025.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//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... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (24025.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//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... -
Net
:: HTTP . start(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil) -> Net :: HTTP (24025.0) -
新しい Net::HTTP オブジェクトを生成し、 TCP コネクション、 HTTP セッションを開始します。
...されていない場合には
プロクシは利用しません。
このメソッドは以下と同じです。
//emlist[例][ruby]{
require 'net/http'
Net::HTTP.new(address, port, proxy_addr, proxy_port, proxy_user, proxy_pass).start(&block)
//}
@param address 接続するホスト名を文字... -
Net
:: HTTP . start(address , port = 80 , proxy _ addr = :ENV , proxy _ port = nil , proxy _ user=nil , proxy _ pass=nil) {|http| . . . . } -> object (24025.0) -
新しい Net::HTTP オブジェクトを生成し、 TCP コネクション、 HTTP セッションを開始します。
...されていない場合には
プロクシは利用しません。
このメソッドは以下と同じです。
//emlist[例][ruby]{
require 'net/http'
Net::HTTP.new(address, port, proxy_addr, proxy_port, proxy_user, proxy_pass).start(&block)
//}
@param address 接続するホスト名を文字... -
Net
:: HTTPExceptions # response -> Net :: HTTPResponse (24025.0) -
例外の原因となったレスポンスオブジェクトを返します。
...例外の原因となったレスポンスオブジェクトを返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.response # => #<Net::HTTPNotFound 404 Not Fou... -
Net
:: HTTPGenericRequest # body -> String (24025.0) -
サーバに送るリクエストのエンティティボディを返します。
...サーバに送るリクエストのエンティティボディを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data"
req.body # => "Test Post Data"
//}
@see Net::HTTPGe... -
Net
:: HTTPGenericRequest # body=(body) (24025.0) -
サーバに送るリクエストのエンティティボディを文字列で設定します。
...ティボディを文字列で設定します。
@param body 設定するボディを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data" # => "Test Post Data... -
Net
:: HTTPGenericRequest # body _ stream -> object (24025.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大... -
Net
:: HTTPGenericRequest # body _ stream=(f) (24025.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大... -
Net
:: HTTPGenericRequest # method -> String (24025.0) -
リクエストの HTTP メソッドを文字列で返します。
...リクエストの HTTP メソッドを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.method # => "POST"
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}... -
Net
:: HTTPGenericRequest # path -> String (24025.0) -
リクエストする path を文字列で返します。
...リクエストする path を文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}... -
Net
:: HTTPGenericRequest # request _ body _ permitted? -> bool (24025.0) -
リクエストにエンティティボディを一緒に送ることが許されている HTTP メソッド (POST など)の場合真を返します。
...ディを一緒に送ることが許されている
HTTP メソッド (POST など)の場合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.request_body_permitted? # => true
head... -
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (24025.0) -
サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。
...ボディを含むことが許されている
HTTP メソッド (GET, POST など)の場合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.response_body_permitted? # => true
head... -
Net
:: HTTPHeader # [](key) -> String|nil (24025.0) -
key ヘッダフィールドを返します。
...しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['user-agent'] # => Ruby
//}
一種類のヘ... -
Net
:: HTTPHeader # []=(key , val) (24025.0) -
key ヘッダフィールドに文字列 val をセットします。
...字列で与えます。
@param val keyで指定したフィールドにセットする文字列を与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['user-agent'] # => Ruby
req['user-agent'] =... -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (24025.0) -
Authorization: ヘッダを BASIC 認証用にセットします。
...unt アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNl... -
Net
:: HTTPHeader # chunked? -> bool (24025.0) -
Transfer-Encoding: ヘッダフィールドが "chunked" である 場合に真を返します。
...ヘッダフィールドが存在しなかったり、
"chunked" 以外である場合には偽を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.chunked? # => false
req["Transfer-Encoding"]... -
Net
:: HTTPHeader # content _ length -> Integer|nil (24025.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...rSyntaxError フィールドの値が不正である場合に
発生します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length... -
Net
:: HTTPHeader # content _ length=(len) (24025.0) -
Content-Length: ヘッダフィールドに値を設定します。
...tent-Length: ヘッダフィールドを
削除します。
@param len 設定する値を整数で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_len... -
Net
:: HTTPHeader # content _ range -> Range|nil (24025.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...Header#range_length で得られます。
ヘッダが設定されていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Ran... -
Net
:: HTTPHeader # content _ type -> String|nil (24025.0) -
"text/html" のような Content-Type を表す 文字列を返します。
...列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.c... -
Net
:: HTTPHeader # content _ type=(type) (24025.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
...タイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => n... -
Net
:: HTTPHeader # delete(key) -> [String] | nil (24025.0) -
key ヘッダフィールドを削除します。
...ます。
key ヘッダフィールドが存在しなかった場合には
nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length # =>... -
Net
:: HTTPHeader # each {|name , val| . . . . } -> () (24025.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...名は小文字で統一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{va... -
Net
:: HTTPHeader # each _ capitalized _ name {|name| . . . . } -> () (24025.0) -
保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。
...持しているヘッダ名を正規化
('x-my-header' -> 'X-My-Header')
して、ブロックに渡します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }
# =... -
Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () (24025.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
...名は小文字で統一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{va... -
Net
:: HTTPHeader # each _ key {|name| . . . } -> () (24025.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
...るヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-e... -
Net
:: HTTPHeader # each _ name {|name| . . . } -> () (24025.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
...るヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-e... -
Net
:: HTTPHeader # each _ value {|value| . . . . } -> () (24025.0) -
保持しているヘッダの値をブロックに渡し、呼びだします。
...値をブロックに渡し、呼びだします。
渡される文字列は ", " で連結したものです。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_value { |value| puts value }
# => gzip;... -
Net
:: HTTPHeader # get _ fields(key) -> [String] (24025.0) -
key ヘッダフィールドの値 (文字列) を配列で返します。
...y は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.get_fields('accept-ranges') # => ["none"]
//}
@see... -
Net
:: HTTPHeader # key?(key) -> bool (24025.0) -
key というヘッダフィールドがあれば真を返します。 key は大文字小文字を区別しません。
...字小文字を区別しません。
@param key 探すヘッダフィールド名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.key?('content-type') # => true
res.key?('nonexist-... -
Net
:: HTTPHeader # main _ type -> String|nil (24025.0) -
"text/html" における "text" のようなタイプを表す 文字列を返します。
...タイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//}... -
Net
:: HTTPHeader # method -> String (24025.0) -
リクエストの HTTP メソッドを文字列で返します。
...リクエストの HTTP メソッドを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}... -
Net
:: HTTPHeader # proxy _ basic _ auth(account , password) -> [String] (24025.0) -
Proxy 認証のために Proxy-Authorization: ヘッダをセットします。
...unt アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "password") # =>... -
Net
:: HTTPHeader # range _ length -> Integer|nil (24025.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
...不正である場合に
発生します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.rang... -
Net
:: HTTPHeader # set _ content _ type(type , params = {}) (24025.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
...タイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => n... -
Net
:: HTTPHeader # sub _ type -> String|nil (24025.0) -
"text/html" における "html" のようなサブタイプを表す 文字列を返します。
...タイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.sub_type # => "html"
//}... -
Net
:: HTTPHeader # type _ params -> Hash (24025.0) -
Content-Type のパラメータを {"charset" => "iso-2022-jp"} という形の Hash で返します。
...返します。
Content-Type: ヘッダフィールドが存在しない場合には
空のハッシュを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.type_params # => {"charset"=>"UTF-8"}
//}... -
Net
:: HTTPRequest (24025.0) -
HTTP リクエストを抽象化するクラスです。
...opfind
* Net::HTTP::Patch
* Net::HTTP::Proppatch
* Net::HTTP::Trace
* Net::HTTP::Unlock
を使用してください。
=== 例
//emlist[][ruby]{
require 'net/http'
http = Net::HTTP.new('www.example.com', 80)
req = Net::HTTP::Get.new('/somefile')
res = http.request(req)
print res.body
//}... -
Net
:: HTTPResponse # body -> String | () | nil (24025.0) -
エンティティボディを返します。
...dapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
Net
:: HTTPResponse # code -> String (24025.0) -
HTTP のリザルトコードです。例えば '302' などです。
...スオブジェクトがどのクラスのインスタンスかを
見ることでもレスポンスの種類を判別できます。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.code # => "200"
//}... -
Net
:: HTTPResponse # entity -> String | () | nil (24025.0) -
エンティティボディを返します。
...dapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
Net
:: HTTPResponse # http _ version -> String (24025.0) -
サーバがサポートしている HTTP のバージョンを文字列で返します。
...サーバがサポートしている HTTP のバージョンを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}... -
Net
:: HTTPResponse # message -> String (24025.0) -
HTTP サーバがリザルトコードに付加して返すメッセージです。 例えば 'Not Found' などです。
...して返すメッセージです。
例えば 'Not Found' などです。
msg は obsolete です。使わないでください。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.message # => "OK"
//}... -
Net
:: HTTPResponse # msg -> String (24025.0) -
HTTP サーバがリザルトコードに付加して返すメッセージです。 例えば 'Not Found' などです。
...して返すメッセージです。
例えば 'Not Found' などです。
msg は obsolete です。使わないでください。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.message # => "OK"
//}... -
Net
:: HTTPResponse . body _ permitted? -> bool (24025.0) -
エンティティボディを含むことが許されているレスポンスクラス ならば真を、そうでなければ偽を返します。
...エンティティボディを含むことが許されているレスポンスクラス
ならば真を、そうでなければ偽を返します。
//emlist[例][ruby]{
require 'net/http'
Net::HTTPSuccess.body_permitted? # => true
Net::HTTPNotModified.body_permitted? # => false
//}... -
Net
:: HTTPResponse :: CODE _ CLASS _ TO _ OBJ -> Hash (24025.0) -
HTTP レスポンスステータスコードの最初の数字からレスポンスのクラス(分類)を あらわすクラスへのハッシュです。
...HTTP レスポンスステータスコードの最初の数字からレスポンスのクラス(分類)を
あらわすクラスへのハッシュです。
//emlist[][ruby]{
require 'net/http'
Net::HTTPResponse::CODE_CLASS_TO_OBJ['3'] # => Net::HTTPRedirection
//}... -
Net
:: HTTPResponse :: CODE _ TO _ OBJ -> Hash (24025.0) -
HTTP レスポンスステータスコードから対応するクラスへのハッシュです。
...HTTP レスポンスステータスコードから対応するクラスへのハッシュです。
//emlist[][ruby]{
require 'net/http'
Net::HTTPResponse::CODE_TO_OBJ['404'] # => Net::HTTPNotFound
//}... -
HTTPSession (24007.0)
-
Alias of Net::HTTP
Alias of Net::HTTP -
Net
:: HTTP (24007.0) -
HTTP のクライアントのためのクラスです。
HTTP のクライアントのためのクラスです。 -
Net
:: HTTP # active? -> bool (24007.0) -
HTTP セッションが開始されていたら真を返します。
HTTP セッションが開始されていたら真を返します。
active? は時代遅れのメソッドです。 -
Net
:: HTTP # address -> String (24007.0) -
接続するアドレスを返します。
接続するアドレスを返します。
@see Net::HTTP.new -
Net
:: HTTP # ca _ file -> String | nil (24007.0) -
信頼する CA 証明書ファイルのパスを返します。
信頼する CA 証明書ファイルのパスを返します。
@see Net::HTTP#ca_file=, OpenSSL::SSL::SSLContext#ca_file -
Net
:: HTTP # ca _ file=(path) (24007.0) -
信頼する CA 証明書ファイルのパスを文字列で設定します。
信頼する CA 証明書ファイルのパスを文字列で設定します。
ファイルには複数の証明書を含んでいても構いません。
詳しくは OpenSSL::SSL::SSLContext#ca_file= を見てください。
デフォルトは nil (指定なし)です。
@param path ファイルパス文字列
@see Net::HTTP#ca_file, OpenSSL::SSL::SSLContext#ca_file= -
Net
:: HTTP # ca _ path -> String | nil (24007.0) -
信頼する CA 証明書ファイルが存在するディレクトリを設定します。
信頼する CA 証明書ファイルが存在するディレクトリを設定します。
@see Net::HTTP#ca_path=, OpenSSL::SSL::SSLContext#ca_path -
Net
:: HTTP # ca _ path=(path) (24007.0) -
信頼する CA 証明書ファイルが存在するディレクトリを設定します。
信頼する CA 証明書ファイルが存在するディレクトリを設定します。
ファイル名はハッシュ値の文字列にしなければなりません。
詳しくは OpenSSL::SSL::SSLContext#ca_path= を見てください。
デフォルトは nil (指定なし)です。
@param path ディレクトリ名文字列
@see Net::HTTP#ca_path, OpenSSL::SSL::SSLContext#ca_path= -
Net
:: HTTP # cert -> OpenSSL :: X509 :: Certificate | nil (24007.0) -
クライアント証明書を返します。
クライアント証明書を返します。
@see Net::HTTP#cert=, OpenSSL::SSL::SSLContext#cert -
Net
:: HTTP # cert=(certificate) (24007.0) -
クライアント証明書を設定します。
クライアント証明書を設定します。
デフォルトは nil (クライアント証明書による認証をしない)です。
@param certificate 証明書オブジェクト(OpenSSL::X509::Certificate)
@see Net::HTTP#cert, OpenSSL::SSL::SSLContext#cert= -
Net
:: HTTP # cert _ store -> OpenSSL :: X509 :: Store | nil (24007.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを返します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを返します。
@see Net::HTTP#cert_store, OpenSSL::SSL::SSLContext#cert_store= -
Net
:: HTTP # cert _ store=(store) (24007.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを設定します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを設定します。
通常は Net::HTTP#ca_file= や Net::HTTP#ca_path= で
設定しますが、より詳細な設定をしたい場合にはこちらを用います。
デフォルトは nil (証明書ストアを指定しない)です。
@see Net::HTTP#cert_store=, OpenSSL::SSL::SSLContext#cert_store -
Net
:: HTTP # ciphers -> String | [String] | nil (24007.0) -
Net::HTTP#ciphers で設定した値を返します。
Net::HTTP#ciphers で設定した値を返します。
OpenSSL::SSL::SSLContext#ciphers が返す値とは
異なるので注意してください。
@see Net::HTTP#ciphers= -
Net
:: HTTP # ciphers=(ciphers) (24007.0) -
利用可能な共通鍵暗号を設定します。
利用可能な共通鍵暗号を設定します。
OpenSSL::SSL::SSLContext#ciphers= と同じ形式で
設定します。詳しくはそちらを参照してください。
@param ciphers 利用可能にする共通鍵暗号の種類
@see Net::HTTP#ciphers -
Net
:: HTTP # close _ on _ empty _ response -> bool (24007.0) -
レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを返します。
レスポンスがボディを持っていない場合にコネクションを
閉じるかどうかを返します。
デフォルトでは偽(閉じない)です。
@see Net::HTTP#close_on_empty_response= -
Net
:: HTTP # close _ on _ empty _ response=(bool) (24007.0) -
レスポンスがボディを持っていない場合にコネクションを 閉じるかどうかを設定します。
レスポンスがボディを持っていない場合にコネクションを
閉じるかどうかを設定します。
@param bool レスポンスがボディを持っていない場合にコネクションを
閉じるかどうか指定します。
@see Net::HTTP#close_on_empty_response -
Net
:: HTTP # continue _ timeout -> Integer | nil (24007.0) -
「100 Continue」レスポンスを待つ秒数を返します。
「100 Continue」レスポンスを待つ秒数を返します。
この秒数待ってもレスポンスが来ない場合は
リクエストボディを送信します。
デフォルトは nil (待たない)です。
@see Net::HTTP#continue_timeout= -
Net
:: HTTP # continue _ timeout=(seconds) (24007.0) -
「100 Continue」レスポンスを待つ秒数を指定します。
「100 Continue」レスポンスを待つ秒数を指定します。
この秒数待ってもレスポンスが来ない場合は
リクエストボディを送信します。
デフォルトは nil (待たない)です。
@param seconds 秒数
@see Net::HTTP#continue_timeout -
Net
:: HTTP # copy(path , initheader = nil) -> Net :: HTTPResponse (24007.0) -
サーバの path に COPY リクエストを ヘッダを initheader として送ります。
サーバの path に COPY リクエストを
ヘッダを initheader として送ります。
レスポンスを Net::HTTPResponse のオブジェクト
で返します。
@param path リクエストを送るパスを文字列で与えます。
@param initheader リクエストのヘッダを「文字列=>文字列」の
ハッシュで与えます。
@see Net::HTTP::Copy -
Net
:: HTTP # delete(path , initheader = nil) -> Net :: HTTPResponse (24007.0) -
サーバの path に DELETE リクエストを ヘッダを initheader として送ります。
サーバの path に DELETE リクエストを
ヘッダを initheader として送ります。
レスポンスを Net::HTTPResponse のオブジェクト
で返します。
@param path リクエストを送るパスを文字列で与えます。
@param initheader リクエストのヘッダを「文字列=>文字列」の
ハッシュで与えます。
@see Net::HTTP::Delete -
Net
:: HTTP # finish -> () (24007.0) -
HTTP セッションを終了します。セッション開始前にこのメソッドが 呼ばれた場合は例外 IOError を発生します。
HTTP セッションを終了します。セッション開始前にこのメソッドが
呼ばれた場合は例外 IOError を発生します。
@raise IOError セッション開始前に呼ぶと発生します。 -
Net
:: HTTP # get2(path , header = nil) -> Net :: HTTPResponse (24007.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。
ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取... -
Net
:: HTTP # get2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (24007.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。
ブロックとともに呼び出されたときは、
エンティティボディをソケットから読み出す前に、
接続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取... -
Net
:: HTTP # head2(path , header = nil) -> Net :: HTTPResponse (24007.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。
ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。
@param path ヘ... -
Net
:: HTTP # head2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (24007.0) -
サーバ上の path にあるエンティティのヘッダのみを取得します。 Net::HTTPResponse オブジェクトを返します。
サーバ上の path にあるエンティティのヘッダのみを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。
ブロックとともに呼び出されたときは、
Net::HTTP#request_get と同じ動作を
しますが、そもそもヘッダしか要求していないので
body は空です。そのためこの動作はそれほど意味はありません。
@param path ヘ... -
Net
:: HTTP # keep _ alive _ timeout -> Integer (24007.0) -
以前のリクエストで使ったコネクションの再利用(keep-alive)を許可する秒数を 返します。
以前のリクエストで使ったコネクションの再利用(keep-alive)を許可する秒数を
返します。
デフォルトは2(秒)です。
@see Net::HTTP#keep_alive_timeout= -
Net
:: HTTP # keep _ alive _ timeout=(seconds) (24007.0) -
以前のリクエストで使ったコネクションの再利用(keep-alive)を許可する秒数を 設定します。
以前のリクエストで使ったコネクションの再利用(keep-alive)を許可する秒数を
設定します。
この秒数以内に同じホストに次のリクエストを送った場合、
ソケットを再利用します。
デフォルトは2(秒)です。これは一般的にサーバ側の keep-alive の秒数
が2秒である場合が多いからです。
@see Net::HTTP#keep_alive_timeout -
Net
:: HTTP # key -> OpenSSL :: PKey :: PKey | nil (24007.0) -
クライアント証明書の秘密鍵を返します。
クライアント証明書の秘密鍵を返します。
@see Net::HTTP#key=, OpenSSL::SSL::SSLContext#key -
Net
:: HTTP # key=(key) (24007.0) -
クライアント証明書の秘密鍵を設定します。
クライアント証明書の秘密鍵を設定します。
OpenSSL::PKey::RSA オブジェクトか
OpenSSL::PKey::DSA オブジェクトを設定します。
デフォルトは nil (鍵なし)です。
@param key 設定する秘密鍵
@see Net::HTTP#key,
OpenSSL::SSL::SSLContext#key= -
Net
:: HTTP # local _ host -> String | nil (24007.0) -
接続に用いるローカルホスト名を返します。
接続に用いるローカルホスト名を返します。
nil の場合システムが適当にローカルホストを
決めます。
デフォルトは nil です。
@see Net::HTTP#local_host=, Net::HTTP#local_port -
Net
:: HTTP # local _ port -> nil | Integer | String (24007.0) -
接続に用いるローカルポートを返します。
接続に用いるローカルポートを返します。
nil の場合システムが適当にローカルポートを
決めます。
デフォルトは nil です。
@see Net::HTTP#local_port=, Net::HTTP#local_host -
Net
:: HTTP # lock(path , body , initheader = nil) -> Net :: HTTPResponse (24007.0) -
サーバの path に LOCK リクエストを ヘッダを initheader, ボディを body として送ります。
サーバの path に LOCK リクエストを
ヘッダを initheader, ボディを body として送ります。
レスポンスを Net::HTTPResponse のオブジェクト
で返します。
@param path リクエストを送るパスを文字列で与えます。
@param body リクエストのボディを文字列で与えます。
@param initheader リクエストのヘッダを「文字列=>文字列」の
ハッシュで与えます。
@see Net::HTTP::Lock -
Net
:: HTTP # mkcol(path , body , initheader = nil) -> Net :: HTTPResponse (24007.0) -
サーバの path に MKCOL リクエストを ヘッダが initheader, ボディを body として送ります。
サーバの path に MKCOL リクエストを
ヘッダが initheader, ボディを body として送ります。
レスポンスを Net::HTTPResponse のオブジェクト
で返します。
@param path リクエストを送るパスを文字列で与えます。
@param body リクエストのボディを文字列で与えます。
@param initheader リクエストのヘッダを「文字列=>文字列」の
ハッシュで与えます。
@see Net::HTTP::Mkcol -
Net
:: HTTP # move(path , body , initheader = nil) -> Net :: HTTPResponse (24007.0) -
サーバの path に MOVE リクエストを ヘッダが initheader, ボディを body として送ります。
サーバの path に MOVE リクエストを
ヘッダが initheader, ボディを body として送ります。
レスポンスを Net::HTTPResponse のオブジェクト
で返します。
@param path リクエストを送るパスを文字列で与えます。
@param body リクエストのボディを文字列で与えます。
@param initheader リクエストのヘッダを「文字列=>文字列」の
ハッシュで与えます。
@see Net::HTTP::Move -
Net
:: HTTP # open _ timeout -> Integer|nil (24007.0) -
接続時に待つ最大秒数を返します。
接続時に待つ最大秒数を返します。
この秒数たってもコネクションが
開かなければ例外 Net::OpenTimeout を発生します。
デフォルトは 60 (秒)です。
@see Net::HTTP#read_timeout, Net::HTTP#open_timeout=