クラス
-
Net
:: HTTP (12) -
Net
:: HTTPGenericRequest (2) -
Net
:: HTTPResponse (2)
キーワード
-
body
_ stream (1) -
body
_ stream= (1) - cert (1)
-
cert
_ store (1) - get (2)
- key (1)
-
open
_ timeout (1) -
open
_ timeout= (1) -
peer
_ cert (1) - post (2)
-
read
_ body (2) -
read
_ timeout (1) -
read
_ timeout= (1)
検索結果
先頭5件
-
Net
:: HTTP # open _ timeout=(seconds) (18349.0) -
接続時に待つ最大秒数を設定します。
接続時に待つ最大秒数を設定します。
この秒数たってもコネクションが
開かなければ例外 Net::OpenTimeout を発生します。
nilを設定するとタイムアウトしなくなります。
以下のコネクションを開くメソッドで有効です。
* Net::HTTP.open
* Net::HTTP#start
@param second 待つ秒数を指定します。
@see Net::HTTP#read_timeout, Net::HTTP#open_timeout -
Net
:: HTTP # open _ timeout -> Integer|nil (18331.0) -
接続時に待つ最大秒数を返します。
接続時に待つ最大秒数を返します。
この秒数たってもコネクションが
開かなければ例外 Net::OpenTimeout を発生します。
デフォルトは 60 (秒)です。
@see Net::HTTP#read_timeout, Net::HTTP#open_timeout= -
Net
:: HTTP # cert -> OpenSSL :: X509 :: Certificate | nil (310.0) -
クライアント証明書を返します。
クライアント証明書を返します。
@see Net::HTTP#cert=, OpenSSL::SSL::SSLContext#cert -
Net
:: HTTP # cert _ store -> OpenSSL :: X509 :: Store | nil (310.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを返します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを返します。
@see Net::HTTP#cert_store, OpenSSL::SSL::SSLContext#cert_store= -
Net
:: HTTP # key -> OpenSSL :: PKey :: PKey | nil (310.0) -
クライアント証明書の秘密鍵を返します。
クライアント証明書の秘密鍵を返します。
@see Net::HTTP#key=, OpenSSL::SSL::SSLContext#key -
Net
:: HTTP # peer _ cert -> OpenSSL :: X509 :: Certificate | nil (310.0) -
サーバの証明書を返します。
サーバの証明書を返します。
SSL/TLS が有効でなかったり、接続前である場合には nil
を返します。
@see OpenSSL::SSL::SSLSocket#peer_cert -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (28.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 (28.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 # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (28.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 (28.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 # read _ timeout -> Integer|nil (28.0) -
読みこみ(read(2)) 一回でブロックしてよい最大秒数 を返します。
読みこみ(read(2)) 一回でブロックしてよい最大秒数
を返します。
この秒数たっても読みこめなければ例外 Net::ReadTimeout
を発生します。
nilはタイムアウトしないことを意味します。
デフォルトは 60 (秒)です。
@see Net::HTTP#open_timeout, Net::HTTP#read_timeout= -
Net
:: HTTP # read _ timeout=(seconds) (28.0) -
読みこみ(read(2)) 一回でブロックしてよい最大秒数を 設定します。
読みこみ(read(2)) 一回でブロックしてよい最大秒数を
設定します。
この秒数たっても読みこめなければ例外 Net::ReadTimeout
を発生します。
nilを設定するとタイムアウトしなくなります。
このタイムアウト秒数はサーバとやりとりするメソッドで有効です。
デフォルトは 60 (秒)です。
@param second 待つ秒数を指定します。
@see Net::HTTP#open_timeout, Net::HTTP#read_timeout -
Net
:: HTTPGenericRequest # body _ stream -> object (28.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) (28.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
:: HTTPResponse # read _ body {|str| . . . . } -> () (28.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 (28.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:/...