るりまサーチ

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

別のキーワード

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

検索結果

<< 1 2 3 ... > >>

URI::HTTP#request_uri -> String (24208.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...

WEBrick::HTTPRequest#request_uri -> URI (24202.0)

リクエスト URI を表す URI オブジェクトを返します。

リクエスト URI を表す URI オブジェクトを返します。

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

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

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

WEBrick::HTTPResponse#request_uri=(uri) (12202.0)

リクエストの URI をセットします。 デフォルトは nil です。

リクエストの URI をセットします。
デフォルトは nil です。

@param uri リクエストの URI を URI オブジェクトで指定します。

Net::HTTPHeader#set_content_type(type, params = {}) (9207.0)

type と params から Content-Type: ヘッダフィールドの 値を設定します。

...type と params から Content-Type: ヘッダフィールドの
値を設定します。

@param type メディアタイプを文字列で指定します。
@param params パラメータ属性をハッシュで指定します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www....
...example.com/index.html')
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"
//}...

絞り込み条件を変える

WEBrick::HTTPRequest#query_string -> String (6217.0)

リクエスト URI のクエリーを文字列で表すアクセサです。 デフォルトは request_uri.query です。

...リクエスト URI のクエリーを文字列で表すアクセサです。
デフォルトは request_uri.query です。...

Net::HTTPHeader#content_length -> Integer|nil (6207.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#fetch(key) -> String (6119.0)

key ヘッダフィールドを返します。

...ドを返します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブ...
...efault 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

u...
...http://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-lengt...

Net::HTTPHeader#fetch(key) {|hash| .... } -> String (6119.0)

key ヘッダフィールドを返します。

...ドを返します。

たとえばキー 'content-length' に対しては '2048'
のような文字列が得られます。キーが存在しなければ nil を返します。

該当するキーが登録されてい
ない時には、引数 default が与えられていればその値を、ブ...
...efault 該当するキーが登録されていない時の返り値を指定します。
@raise IndexError 引数defaultもブロックも与えられてない時、キーの探索に 失敗すると発生します。

//emlist[例 key のみ指定。key が存在する][ruby]{
require 'net/http'

u...
...http://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-lengt...
<< 1 2 3 ... > >>