るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
16件ヒット [1-16件を表示] (0.029秒)

別のキーワード

  1. socket open
  2. _builtin open
  3. csv open
  4. tempfile open
  5. zlib open

検索結果

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:/...