るりまサーチ

最速Rubyリファレンスマニュアル検索!
88件ヒット [1-88件を表示] (0.144秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クラス:Net::HTTPGenericRequest[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

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

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

...ムで設定します。
f は read(size) メソッドが定義されている必要があります。

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

//emlist[例][ruby]{
r
equire '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.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}...

Net::HTTPGenericRequest#request_body_permitted? -> bool (6201.0)

リクエストにエンティティボディを一緒に送ることが許されている HTTP メソッド (POST など)の場合真を返します。

...場合真を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.request_body_permitted? # => true

head = Net::HTTP::Head.new(uri.request_uri)
head.request_body_permitted? # => false
//}...

Net::HTTPGenericRequest#response_body_permitted? -> bool (6201.0)

サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。

...合真を返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.response_body_permitted? # => true

head = Net::HTTP::Head.new(uri.request_uri)
head.response_body_permitted? # => false
//}...

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

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

...ムで設定します。
f は read(size) メソッドが定義されている必要があります。

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

//emlist[例][ruby]{
r
equire '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.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}...

Net::HTTPGenericRequest#body -> String (3201.0)

サーバに送るリクエストのエンティティボディを返します。

...クエストのエンティティボディを返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Post.new(uri.request_uri)
r
eq.body = "Test Post Data"
r
eq.body # => "Test Post Data"
//}

@see Net::HTTPGenericRequest#body=...

絞り込み条件を変える

Net::HTTPGenericRequest#method -> String (3201.0)

リクエストの HTTP メソッドを文字列で返します。

...リクエストの HTTP メソッドを文字列で返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Post.new(uri.request_uri)
r
eq.method # => "POST"
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.method # => "GET"
//}...

Net::HTTPGenericRequest#path -> String (3201.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index.html')
r
eq = Net::HTTP::Get.new(uri.request_uri)
r
eq.path # => "/index.html"
//}...

Net::HTTPGenericRequest#body_exist? -> bool (3101.0)

このメソッドは obsolete です。

...このメソッドは obsolete です。


Net::HTTPGenericRequest
#response_body_permitted?
の別名です。...