ライブラリ
-
net
/ http (374) - uri (11)
-
webrick
/ httprequest (22) -
webrick
/ httpresponse (22)
クラス
-
Net
:: HTTPGenericRequest (88) -
URI
:: HTTP (11) -
WEBrick
:: HTTPRequest (22) -
WEBrick
:: HTTPResponse (22)
モジュール
-
Net
:: HTTPHeader (286)
キーワード
- [] (11)
- []= (11)
-
basic
_ auth (11) - body (11)
- body= (11)
-
body
_ stream (11) -
body
_ stream= (11) - chunked? (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type (11) -
content
_ type= (11) - delete (11)
- each (11)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - fetch (33)
-
form
_ data= (11) - method (22)
- path (11)
-
proxy
_ basic _ auth (11) -
query
_ string (11) -
query
_ string= (11) - range (11)
-
range
_ length (11) -
request
_ body _ permitted? (11) -
request
_ uri= (11) -
response
_ body _ permitted? (11) -
set
_ content _ type (11) -
set
_ form _ data (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # request _ uri -> URI | nil (21202.0) -
リクエストの URI を返します。
リクエストの URI を返します。 -
URI
:: HTTP # request _ uri -> String (18208.0) -
自身の「path + '?' + query」を文字列で返します。 query が nil である場合は、自身の path を返します。
...字列で返します。
query が nil である場合は、自身の path を返します。
path が空である場合には、path は「'/'」であるとします。
例:
require 'uri'
u = URI.parse("http://example.com/search?q=xxx")
p u.request_uri #=>... -
Net
:: HTTPHeader # content _ length -> Integer|nil (9307.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...Content-Length: ヘッダフィールドの表している値を整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。......//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 # => nil
req.content_length = 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # content _ length=(len) (9207.0) -
Content-Length: ヘッダフィールドに値を設定します。
...Content-Length: ヘッダフィールドに値を設定します。
len に nil を与えると Content-Length: ヘッダフィールドを
削除します。
@param len 設定する値を整数で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/ind......ex.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length # => nil
req.content_length = 10 # => 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # content _ range -> Range|nil (9207.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...Content-Range: ヘッダフィールドの値を Range で返します。
Range の表わす長さは Net::HTTPHeader#range_length で得られます。
ヘッダが設定されていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
Net
:: HTTPHeader # content _ type -> String|nil (9207.0) -
"text/html" のような Content-Type を表す 文字列を返します。
...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)
re......q.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}... -
Net
:: HTTPHeader # content _ type=(type) (9207.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
...ら Content-Type: ヘッダフィールドの
値を設定します。
@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.h......tml')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}... -
Net
:: HTTPHeader # range _ length -> Integer|nil (9207.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
...Content-Range: ヘッダフィールドの表している長さを整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である......発生します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.range_length # => 500
//}... -
Net
:: HTTPHeader # set _ content _ type(type , params = {}) (9207.0) -
type と params から Content-Type: ヘッダフィールドの 値を設定します。
...ら Content-Type: ヘッダフィールドの
値を設定します。
@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.h......tml')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data' # => "multipart/form-data"
req.content_type # => "multipart/form-data"
//}... -
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (9113.0) -
サーバからのレスポンスにエンティティボディを含むことが許されている 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.response_body_permitted? # => false
//}...