別のキーワード
種類
- インスタンスメソッド (8)
- クラス (2)
- ライブラリ (1)
ライブラリ
-
net
/ http (10)
クラス
モジュール
-
Net
:: HTTPHeader (1)
キーワード
- HTTPRequest (1)
- Post (1)
- body (1)
- body= (1)
-
body
_ stream (1) -
body
_ stream= (1) -
content
_ type (1) - method (1)
-
net
/ http (1) -
request
_ body _ permitted? (1) -
response
_ body _ permitted? (1)
検索結果
先頭5件
-
Net
:: HTTP :: Post (69001.0) -
HTTP の POST リクエストを表すクラスです。
HTTP の POST リクエストを表すクラスです。 -
Net
:: HTTPGenericRequest # body -> String (19.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) (19.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 # body _ stream -> object (19.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
サーバに送るリクエストのエンティティボディを
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') d... -
Net
:: HTTPGenericRequest # body _ stream=(f) (19.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
サーバに送るリクエストのエンティティボディを
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') d... -
Net
:: HTTPGenericRequest # method -> String (19.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 (19.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::HTTP::Head.new(uri.request_uri)
head.request_bo... -
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (19.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::HTTP::Head.new(uri.request_uri)
head.r... -
Net
:: HTTPHeader # content _ type -> String|nil (19.0) -
"text/html" のような Content-Type を表す 文字列を返します。
"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.content_type = 'multipart/for... -
Net
:: HTTPRequest (19.0) -
HTTP リクエストを抽象化するクラスです。
HTTP リクエストを抽象化するクラスです。
Net::HTTPRequest は抽象クラスなので実際にはサブクラスの
* Net::HTTP::Get
* Net::HTTP::Head
* Net::HTTP::Post
* Net::HTTP::Put
* Net::HTTP::Copy
* Net::HTTP::Delete
* Net::HTTP::Lock
* Net::HTTP::Mkcol
* Net::HTTP::Move
* Net::HTTP::Options
* Net::HTTP::Propfind
* Net::H... -
net
/ http (19.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
汎用データ転送プロトコル HTTP を扱うライブラリです。
実装は 2616 に基きます。
=== 使用例
==== ウェブサーバからドキュメントを得る (GET)
//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://w...