209件ヒット
[1-100件を表示]
(0.138秒)
ライブラリ
-
net
/ http (187) -
webrick
/ httprequest (11) -
webrick
/ httpresponse (11)
クラス
-
Net
:: HTTPGenericRequest (22) -
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (11)
モジュール
-
Net
:: HTTPHeader (165)
キーワード
- [] (11)
- []= (11)
- chunked? (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type (11) - delete (11)
- each (11)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ value (11) - fetch (11)
-
query
_ string= (11) - range (11)
-
range
_ length (11) -
request
_ body _ permitted? (11) -
response
_ body _ permitted? (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # request _ uri -> URI | nil (18202.0) -
リクエストの URI を返します。
リクエストの URI を返します。 -
Net
:: HTTPHeader # content _ length=(len) (6207.0) -
Content-Length: ヘッダフィールドに値を設定します。
...-Length: ヘッダフィールドに値を設定します。
len に nil を与えると Content-Length: ヘッダフィールドを
削除します。
@param len 設定する値を整数で与えます。
//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 # => 10
req.content_length # => 10
//}... -
Net
:: HTTPHeader # each _ value {|value| . . . . } -> () (6207.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 # content _ length -> Integer|nil (6107.0) -
Content-Length: ヘッダフィールドの表している値を整数で返します。
...t-Length: ヘッダフィールドの表している値を整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError フィールドの値が不正である場合に
発生します。
//emli......st[例][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 # delete(key) -> [String] | nil (6107.0) -
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 # => 10
req.delete("Content-Length") # => ["10"]
req.content_length # => nil
//}... -
Net
:: HTTPHeader # each _ capitalized _ name {|name| . . . . } -> () (6107.0) -
保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。
...-my-header' -> 'X-My-Header')
して、ブロックに渡します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }
# => Accept-Encoding
# => Accept
# => User-Age... -
Net
:: HTTPHeader # range _ length -> Integer|nil (6107.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
...ない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である場合に
発生します。
//emlist[例][ruby]{
requi......re '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 # fetch(key , default) -> String (119.0) -
key ヘッダフィールドを返します。
...を返します。
たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。
該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブロ......文字列で与えます。
@param default 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。
//emlist[例 key のみ指定。key が存在....../www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("user-agent") # => "Ruby"
//}
//emlist[例 key のみ指定。key が存在しない][ruby]{
require 'net/http'
begin
req.fetch("content-length")
rescue => e
e # => #<KeyError: key not found: "content-length">
en... -
WEBrick
:: HTTPRequest # query _ string=(value) (117.0) -
リクエスト URI のクエリーを文字列で表すアクセサです。 デフォルトは request_uri.query です。
...リクエスト URI のクエリーを文字列で表すアクセサです。
デフォルトは request_uri.query です。
@param value クエリーを表す文字列を指定します。... -
Net
:: HTTPGenericRequest # request _ body _ permitted? -> bool (113.0) -
リクエストにエンティティボディを一緒に送ることが許されている 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_body_permitted? # => false
//}...