るりまサーチ

最速Rubyリファレンスマニュアル検索!
3560件ヒット [1-100件を表示] (0.130秒)
トップページ > クエリ:t[x] > クエリ:net/http[x]

別のキーワード

  1. net/smtp start
  2. net/http get
  3. net/imap name
  4. net/imap param
  5. net/pop pop

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

net/http (44048.0)

汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。

...ル HTTP を扱うライブラリです。
実装は 2616 に基きます。

=== 使用例

==== ウェブサーバからドキュメントを得る (GET)

//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}

//emlist[例...
...net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}

//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'

url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http.get('/index.ht...
...ml')
}
puts res.body
//}

//emlist[例4: 上の例よりさらに汎用的な例][ruby]{
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
//}

==== フォ...

Net::HTTPHeader#set_content_type(type, params = {}) (17206.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param 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 # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}...

Net::HTTP#continue_timeout -> Integer | nil (17200.0)

「100 Continue」レスポンスを待つ秒数を返します。

...「100 Continue」レスポンスを待つ秒数を返します。

この秒数待ってもレスポンスが来ない場合は
リクエストボディを送信します。

デフォルトは nil (待たない)です。

@see Net::HTTP#continue_timeout=...

Net::HTTP#continue_timeout=(seconds) (17200.0)

「100 Continue」レスポンスを待つ秒数を指定します。

...「100 Continue」レスポンスを待つ秒数を指定します。

この秒数待ってもレスポンスが来ない場合は
リクエストボディを送信します。

デフォルトは nil (待たない)です。

@param seconds 秒数
@see Net::HTTP#continue_timeout...

Net::HTTPRequestTimeOut (17000.0)

HTTP レスポンス 408 (Request Timeout) を表現するクラスです。

...HTTP レスポンス 408 (Request Timeout) を表現するクラスです。

詳しくは 7231 Section 6.5.7 を見てください。...
...Alias of Net::HTTPRequestTimeout...

絞り込み条件を変える

Net::HTTPRequestTimeout (17000.0)

HTTP レスポンス 408 (Request Timeout) を表現するクラスです。

...HTTP レスポンス 408 (Request Timeout) を表現するクラスです。

詳しくは 7231 Section 6.5.7 を見てください。...

Net::HTTPHeader#content_length -> Integer|nil (14206.0)

Content-Length: ヘッダフィールドの表している値を整数で返します。

...Content-Length: ヘッダフィールドの表している値を整数で返します。

ヘッダが設定されていない場合には nil を返します。

@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。...
...//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 = 10
req.content_length # => 10
//}...

Net::HTTP#ca_path=(path) (14200.0)

信頼する CA 証明書ファイルが存在するディレクトリを設定します。

...イル名はハッシュ値の文字列にしなければなりません。
詳しくは OpenSSL::SSL::SSLContext#ca_path= を見てください。

デフォルトは nil (指定なし)です。

@param path ディレクトリ名文字列
@see Net::HTTP#ca_path, OpenSSL::SSL::SSLContext#ca_path=...

Net::HTTP#verify_depth=(depth) (14200.0)

証明書チェイン上の検証する最大の深さを設定します。

...証明書チェイン上の検証する最大の深さを設定します。

デフォルトは nil で、この場合 OpenSSL のデフォルト値(9)が使われます。

@param depth 最大深さを表す整数
@see Net::HTTP#verify_depth, OpenSSL::SSL::SSLContext#verify_depth=...
<< 1 2 3 ... > >>