るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.015秒)
トップページ > クエリ:post[x] > クエリ:body_stream=[x]

別のキーワード

  1. httprequest body
  2. net/http body
  3. httpresponse body
  4. net/http read_body
  5. httpresponse read_body

ライブラリ

クラス

検索結果

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

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

...('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 # => #<File:/path/to/te...

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

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

...('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 # => #<File:/path/to/te...