るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.109秒)
トップページ > ライブラリ:net/http[x] > バージョン:2.7.0[x] > クエリ:Net::HTTP::Post[x]

別のキーワード

  1. new openssl::bn
  2. new openssl::asn1::asn1data
  3. new openssl::pkey::ec::group
  4. new openssl::x509::certificate
  5. start net::smtp

検索結果

Net::HTTP::Post (69007.0)

HTTP の POST リクエストを表すクラスです。

HTTP の POST リクエストを表すクラスです。

Net::HTTPGenericRequest#body -> String (25.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::HTTPGe...

Net::HTTPGenericRequest#body=(body) (25.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...

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

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

...

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

//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|
# 大...

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

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

...

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

//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|
# 大...

絞り込み条件を変える

Net::HTTPGenericRequest#method -> String (25.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::HTTPGenericRequest#request_body_permitted? -> bool (25.0)

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

...ディを一緒に送ることが許されている
HTTP メソッド (POST など)の場合真を返します。

//emlist[例][ruby]{
require '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::HTTPGenericRequest#response_body_permitted? -> bool (25.0)

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

...ボディを含むことが許されている
HTTP メソッド (GET, POST など)の場合真を返します。

//emlist[例][ruby]{
require '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::HTTPHeader#content_type -> String|nil (25.0)

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

...列を返します。

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.c...

Net::HTTPRequest (25.0)

HTTP リクエストを抽象化するクラスです。

...opfind
* Net::HTTP::Patch
* Net::HTTP::Proppatch
* Net::HTTP::Trace
* Net::HTTP::Unlock

を使用してください。

=== 例

//emlist[][ruby]{
require 'net/http'
http = Net::HTTP.new('www.example.com', 80)
req = Net::HTTP::Get.new('/somefile')
res = http.request(req)
print res.body
//}...

絞り込み条件を変える