るりまサーチ

最速Rubyリファレンスマニュアル検索!
216件ヒット [101-200件を表示] (0.050秒)

別のキーワード

  1. webrick/httpservlet do_post
  2. net/http post
  3. http post
  4. http post2
  5. net/http post2

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 > >>

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

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

...ire '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...

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

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

...ire '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...

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

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

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

//emlist[例][ruby]{
require 'net/http'

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

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

Net::HTTPGenericRequest#body=(body) (21.0)

サーバに送るリクエストのエンティティボディを文字列で設定します。

...

@param body 設定するボディを文字列で与えます。

//emlist[例][ruby]{
require 'net/http'

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

@see Net::HTTPGenericRequest#body...

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

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

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

//emlist[例][ruby]{
require 'net/http'

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

絞り込み条件を変える

Net::HTTPHeader#content_type -> String|nil (15.0)

"text/html" のような Content-Type を表す 文字列を返します。

...フィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.conten...

Net::HTTP#patch(path, data, initheader=nil, dest=nil) -> Net::HTTPResponse (9.0)

サーバ上の path にあるエンティティに対し文字列 data を PATCH リクエストで送ります。

...
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param path POST先のパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用...

Net::HTTP#patch(path, data, initheader=nil, dest=nil) {|body_segment| ... } -> Net::HTTPResponse (9.0)

サーバ上の path にあるエンティティに対し文字列 data を PATCH リクエストで送ります。

...
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param path POST先のパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用...

Net::HTTP#request(request, data = nil) -> Net::HTTPResponse (9.0)

Net::HTTPRequest オブジェクト request をサーバに送信します。

...Net::HTTPRequest オブジェクト request をサーバに送信します。

POST
/PUT の時は data も与えられます
(GET/HEAD などで data を与えると
ArgumentError を発生します)。

ブロックとともに呼びだされたときは
ソケットからボディを読みこ...
<< < 1 2 3 > >>