552件ヒット
[1-100件を表示]
(0.122秒)
種類
- インスタンスメソッド (396)
- 文書 (84)
- ライブラリ (36)
- モジュール (24)
- モジュール関数 (12)
ライブラリ
-
cgi
/ core (24) - drb (12)
-
net
/ http (96) - optparse (144)
-
rexml
/ document (36) -
webrick
/ httprequest (48) -
webrick
/ httputils (60) -
win32
/ registry (12)
クラス
- CGI (24)
-
Net
:: HTTPResponse (12) - OptionParser (144)
-
REXML
:: Attributes (36) -
WEBrick
:: HTTPRequest (48) -
WEBrick
:: HTTPUtils :: FormData (48) -
Win32
:: Registry (12)
モジュール
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (60) -
WEBrick
:: HTTPUtils (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - DRbProtocol (12)
- HTTPExceptions (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 1 . 0 (4) - []= (12)
-
canonical
_ each (12) - each (24)
-
each
_ attribute (12) -
each
_ capitalized (12) -
each
_ header (12) -
each
_ value (12) - filename (12)
- filename= (12)
- header (12)
- info (12)
- name (12)
- name= (12)
-
net
/ http (12) -
net
/ imap (12) - on (144)
- out (12)
-
path
_ info= (12) -
query
_ string= (12) - response (12)
-
rexml
/ document (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
script
_ name= (12) -
split
_ header _ value (12) - user= (12)
検索結果
先頭5件
-
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='<'/>
</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 を文字列で指定します。...