るりまサーチ

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

別のキーワード

  1. rss title=
  2. rss date=
  3. rss description=
  4. rss link=
  5. rss content=

ライブラリ

クラス

検索結果

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

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

...t[例][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
post["Content-Length"] = f....

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

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

...t[例][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
post["Content-Length"] = f....