ライブラリ
-
net
/ http (11) - uri (1)
-
webrick
/ httprequest (2) -
webrick
/ httpresponse (1)
クラス
-
Net
:: HTTPGenericRequest (6) -
URI
:: HTTP (1) -
WEBrick
:: HTTPRequest (2) -
WEBrick
:: HTTPResponse (1)
モジュール
-
Net
:: HTTPHeader (5)
キーワード
-
basic
_ auth (1) - body (1)
-
body
_ stream (1) - chunked? (1)
-
each
_ value (1) - fetch (1)
- method (1)
- path (1)
-
proxy
_ basic _ auth (1) -
query
_ string (1) -
request
_ body _ permitted? (1) -
response
_ body _ permitted? (1)
検索結果
先頭5件
-
URI
:: HTTP # request _ uri -> String (81961.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 # request _ uri -> URI (81907.0) -
リクエスト URI を表す URI オブジェクトを返します。
リクエスト URI を表す URI オブジェクトを返します。 -
WEBrick
:: HTTPResponse # request _ uri -> URI | nil (72907.0) -
リクエストの URI を返します。
リクエストの URI を返します。 -
WEBrick
:: HTTPRequest # query _ string -> String (27652.0) -
リクエスト URI のクエリーを文字列で表すアクセサです。 デフォルトは request_uri.query です。
リクエスト URI のクエリーを文字列で表すアクセサです。
デフォルトは request_uri.query です。 -
Net
:: HTTPGenericRequest # request _ body _ permitted? -> bool (27640.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
:: HTTPHeader # each _ value {|value| . . . . } -> () (18922.0) -
保持しているヘッダの値をブロックに渡し、呼びだします。
保持しているヘッダの値をブロックに渡し、呼びだします。
渡される文字列は ", " で連結したものです。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_value { |value| puts value }
# => gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => */*
# => Ruby
//} -
Net
:: HTTPHeader # basic _ auth(account , password) -> [String] (18622.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 # chunked? -> bool (18622.0) -
Transfer-Encoding: ヘッダフィールドが "chunked" である 場合に真を返します。
Transfer-Encoding: ヘッダフィールドが "chunked" である
場合に真を返します。
Transfer-Encoding: ヘッダフィールドが存在しなかったり、
"chunked" 以外である場合には偽を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.chunked? # => false
req["Transfer-Encodin... -
Net
:: HTTPHeader # proxy _ basic _ auth(account , password) -> [String] (18622.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... -
Net
:: HTTPGenericRequest # method -> String (9340.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 # response _ body _ permitted? -> bool (9340.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
:: HTTPGenericRequest # body -> String (9322.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 _ stream -> object (9322.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 # path -> String (9322.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 # fetch(key , default) -> String (658.0) -
key ヘッダフィールドを返します。
key ヘッダフィールドを返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロッ
クが与えられていればそのブロックを評価した値を返します。
一種類のヘッダフィールドが一つのヘッダの中に複数存在する
場合にはそれを全て ", " で連結した文字列を返します。
key は大文字小文字を区別しません。
@param key ヘッダフィール名を文字列で与えます。
@param default 該...