るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.130秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:g[x] > クエリ:index[x] > クエリ:length[x] > クラス:Net::HTTPGenericRequest[x]

別のキーワード

  1. openssl g=
  2. openssl g
  3. dsa g
  4. dsa g=
  5. dh g

ライブラリ

キーワード

検索結果

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

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

...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
post["Content-Length"] = f.size
end
post.body_stream # => #<...

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

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

...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
post["Content-Length"] = f.size
end
post.body_stream # => #<...