るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.035秒)
トップページ > クエリ:File[x] > クエリ:IO[x] > ライブラリ:net/http[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file size
  4. file open
  5. file path

クラス

キーワード

検索結果

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

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

...
IO
オブジェクトなどのストリームで設定します。
f は read(size) メソッドが定義されている必要があります。

@param f エンティティボディのデータを得るストリームオブジェクトを与えます。

//emlist[例][ruby]{
require 'net/http'...
...e.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/test (closed)>
//}...

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

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

...
IO
オブジェクトなどのストリームで設定します。
f は read(size) メソッドが定義されている必要があります。

@param f エンティティボディのデータを得るストリームオブジェクトを与えます。

//emlist[例][ruby]{
require 'net/http'...
...e.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/test (closed)>
//}...