るりまサーチ

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

別のキーワード

  1. request new
  2. request sign
  3. request verify
  4. request to_der
  5. http request_get

検索結果

<< < 1 2 3 4 5 > >>

Net::HTTPGenericRequest#body=(body) (7.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"
//}

@see Net::HTTPGenericRequest#body...

Net::HTTPGenericRequest#body_stream -> object (7.0)

サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。

...を与えます。

//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|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f...

Net::HTTPGenericRequest#body_stream=(f) (7.0)

サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。

...を与えます。

//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|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f...

Net::HTTPGenericRequest#path -> String (7.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::HTTPHeader#[](key) -> String|nil (7.0)

key ヘッダフィールドを返します。

...l を返します。

//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) (7.0)

key ヘッダフィールドに文字列 val をセットします。

...を与えます。

//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'] = "update"
req['user-agent'] # => update
//}

@see Net::HTTPHeader#[] ,
Net::HTTPHeader#add_f...

Net::HTTPHeader#basic_auth(account, password) -> [String] (7.0)

Authorization: ヘッダを BASIC 認証用にセットします。

...ト名を文字列で与えます。
@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 dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#chunked? -> bool (7.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"] = "chunked"
req.chunked? # => true
//}...

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

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

...正である場合に
発生します。

//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
//}...
<< < 1 2 3 4 5 > >>