るりまサーチ

最速Rubyリファレンスマニュアル検索!
552件ヒット [1-100件を表示] (0.122秒)
トップページ > クエリ:t[x] > クエリ:HTTP[x] > クエリ:value[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. t61string new
  4. matrix t
  5. fiddle align_size_t

検索結果

<< 1 2 3 ... > >>

Net::HTTPResponse#value -> nil (24155.0)

レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。

...ます。

@raise HTTPError レスポンスが 1xx であるか、 net/http が知らない
種類のレスポンスである場合に発生します。
@raise HTTPRetriableError レスポンスが 3xx である場合に発生します。
@raise HTTPServerException レスポンス...
...
@raise HTTPFatalError レスポンスが 5xx である場合に発生します。

//emlist[例 レスポンスが 2xx(成功)][ruby]{
require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.value # => nil
//}

//emlist[例 レス...
...ポンスが 2xx以外][ruby]{
require 'net/http'

uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.class # => Net::HTTPServerException
e.message # => 404 "Not Found"
end
//}...

WEBrick::HTTPUtils.#split_header_value(str) -> Array (15223.0)

HTTP ヘッダの値を分割して返します。

...
HTTP
ヘッダの値を分割して返します。

@param str HTTP ヘッダの値を返します。...

net/http (12316.0)

汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。

... HTTP を扱うライブラリです。
実装は 2616 に基きます。

=== 使用例

==== ウェブサーバからドキュメントを得る (GET)

//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}

//emlist[例...
...et/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}

//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'

url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http
.get('/index.htm...
...e.com/todo.cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack', 'pass'
req.set_form_data({'from'=>'2005-01-01', 'to'=>'2005-03-31'})
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
case res
when Net::HTTPSuccess, Net::HTTPRedirection
# OK
else
res.value
end...

Net::HTTPHeader#each_value {|value| .... } -> () (12238.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::HTTPExceptions (12022.0)

HTTP 例外クラスです。

...HTTP 例外クラスです。

実際にはこれを include した以下のサブクラスの
例外が発生します。

* Net::HTTPError
* Net::HTTPRetriableError
* Net::HTTPServerException
* Net::HTTPFatalError

また、例外を発生させるためには Net::HTTPResponse#value...

絞り込み条件を変える

REXML::Attributes#each_attribute {|attribute| ... } -> () (9230.0)

各属性に対しブロックを呼び出します。

...ML::Attribute オブジェクトで渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a")...
....first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

WEBrick::HTTPRequest#path_info=(value) (9207.0)

リクエスト URI のパスをセットします。

...リクエスト URI のパスをセットします。

@param value リクエスト URI のパスを指定します。...

WEBrick::HTTPRequest#query_string=(value) (9207.0)

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

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

@param value クエリーを表す文字列を指定します。...

WEBrick::HTTPRequest#script_name=(value) (9207.0)

CGI での環境変数 SCRIPT_NAME を文字列で表すアクセサです。

...CGI での環境変数 SCRIPT_NAME を文字列で表すアクセサです。

@param value SCRIPT_NAME を文字列で指定します。...
<< 1 2 3 ... > >>