108件ヒット
[101-108件を表示]
(0.047秒)
別のキーワード
クラス
-
Net
:: HTTP (72) -
Net
:: HTTPGenericRequest (24) -
RubyVM
:: InstructionSequence (12)
キーワード
-
body
_ stream (12) -
body
_ stream= (12) - post2 (24)
-
request
_ post (24) -
to
_ a (12)
検索結果
-
Net
:: HTTPGenericRequest # body _ stream=(f) (55.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
post["Content-Lengt......h"] = f.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}...