るりまサーチ

最速Rubyリファレンスマニュアル検索!
209件ヒット [1-100件を表示] (0.138秒)

別のキーワード

  1. request new
  2. http request_get
  3. request sign
  4. request verify
  5. http request_put

検索結果

<< 1 2 3 > >>

WEBrick::HTTPResponse#request_uri -> URI | nil (18202.0)

リクエストの URI を返します。

リクエストの URI を返します。

Net::HTTPHeader#content_length=(len) (6207.0)

Content-Length: ヘッダフィールドに値を設定します。

...-Length: ヘッダフィールドに値を設定します。

l
en に 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
//}...

絞り込み条件を変える

<< 1 2 3 > >>