ライブラリ
-
net
/ http (12) - uri (1)
-
webrick
/ httprequest (2)
クラス
-
Net
:: HTTPGenericRequest (3) -
URI
:: HTTP (1) -
WEBrick
:: HTTPRequest (2)
モジュール
-
Net
:: HTTPHeader (9)
キーワード
- [] (1)
-
basic
_ auth (1) - body (1)
-
content
_ type (1) - delete (1)
- fetch (3)
- method (2)
- path (1)
-
proxy
_ basic _ auth (1) -
query
_ string (1) -
query
_ string= (1)
検索結果
先頭5件
-
URI
:: HTTP # request _ uri -> String (54931.0) -
自身の「path + '?' + query」を文字列で返します。 query が nil である場合は、自身の path を返します。
自身の「path + '?' + query」を文字列で返します。
query が nil である場合は、自身の path を返します。
path が空である場合には、path は「'/'」であるとします。
例:
require 'uri'
u = URI.parse("http://example.com/search?q=xxx")
p u.request_uri #=> "/search?q=xxx" -
WEBrick
:: HTTPRequest # query _ string -> String (37264.0) -
リクエスト URI のクエリーを文字列で表すアクセサです。 デフォルトは request_uri.query です。
リクエスト URI のクエリーを文字列で表すアクセサです。
デフォルトは request_uri.query です。 -
WEBrick
:: HTTPRequest # query _ string=(value) (36658.0) -
リクエスト URI のクエリーを文字列で表すアクセサです。 デフォルトは request_uri.query です。
リクエスト URI のクエリーを文字列で表すアクセサです。
デフォルトは request_uri.query です。
@param value クエリーを表す文字列を指定します。 -
Net
:: HTTPHeader # fetch(key) -> String (676.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@param default 該... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (676.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@param default 該... -
Net
:: HTTPHeader # fetch(key , default) -> String (676.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@param default 該... -
Net
:: HTTPGenericRequest # method -> String (646.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 # body -> String (628.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 # path -> String (628.0) -
リクエストする path を文字列で返します。
リクエストする path を文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//} -
Net
:: HTTPHeader # [](key) -> String|nil (628.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['user-agent'] # => Ruby
//}
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て... -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (628.0) -
Authorization: ヘッダを BASIC 認証用にセットします。
Authorization: ヘッダを BASIC 認証用にセットします。
@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}... -
Net
:: HTTPHeader # content _ type -> String|nil (628.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
:: HTTPHeader # delete(key) -> [String] | nil (628.0) -
key ヘッダフィールドを削除します。
key ヘッダフィールドを削除します。
@param key 削除するフィールド名
@return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length... -
Net
:: HTTPHeader # method -> String (628.0) -
リクエストの HTTP メソッドを文字列で返します。
リクエストの HTTP メソッドを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//} -
Net
:: HTTPHeader # proxy _ basic _ auth(account , password) -> [String] (628.0) -
Proxy 認証のために Proxy-Authorization: ヘッダをセットします。
Proxy 認証のために Proxy-Authorization: ヘッダをセットします。
@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.proxy_basic_auth("account", "password") # => ["Ba...