種類
- インスタンスメソッド (1294)
- クラス (745)
- 特異メソッド (208)
- モジュール (16)
クラス
-
Net
:: HTTP (982) -
Net
:: HTTPGenericRequest (72) -
Net
:: HTTPRequest (8) -
Net
:: HTTPResponse (104)
モジュール
-
Net
:: HTTPExceptions (8) -
Net
:: HTTPHeader (328)
キーワード
- Copy (8)
- Delete (8)
- Get (8)
- HTTP (8)
- HTTPAccepted (8)
- HTTPAlreadyReported (4)
- HTTPBadGateway (8)
- HTTPBadRequest (8)
- HTTPBadResponse (8)
- HTTPClientError (8)
- HTTPClientException (3)
- HTTPConflict (8)
- HTTPContinue (8)
- HTTPCreated (8)
- HTTPEarlyHints (3)
- HTTPError (8)
- HTTPExceptions (8)
- HTTPExpectationFailed (8)
- HTTPFailedDependency (8)
- HTTPFatalError (8)
- HTTPForbidden (8)
- HTTPFound (8)
- HTTPGatewayTimeOut (8)
- HTTPGatewayTimeout (3)
- HTTPGenericRequest (8)
- HTTPGone (8)
- HTTPHeader (8)
- HTTPHeaderSyntaxError (8)
- HTTPIMUsed (8)
- HTTPInformation (8)
- HTTPInsufficientStorage (8)
- HTTPInternalServerError (8)
- HTTPLengthRequired (8)
- HTTPLocked (8)
- HTTPLoopDetected (4)
- HTTPMethodNotAllowed (8)
- HTTPMisdirectedRequest (4)
- HTTPMovedPermanently (8)
- HTTPMovedTemporarily (8)
- HTTPMultiStatus (8)
- HTTPMultipleChoice (8)
- HTTPMultipleChoices (8)
- HTTPNetworkAuthenticationRequired (8)
- HTTPNoContent (8)
- HTTPNonAuthoritativeInformation (8)
- HTTPNotAcceptable (8)
- HTTPNotExtended (4)
- HTTPNotFound (8)
- HTTPNotImplemented (8)
- HTTPNotModified (8)
- HTTPOK (8)
- HTTPPartialContent (8)
- HTTPPayloadTooLarge (3)
- HTTPPaymentRequired (8)
- HTTPPermanentRedirect (7)
- HTTPPreconditionFailed (8)
- HTTPPreconditionRequired (8)
- HTTPProcessing (4)
- HTTPProxyAuthenticationRequired (8)
- HTTPRangeNotSatisfiable (3)
- HTTPRedirection (8)
- HTTPRequest (8)
- HTTPRequestEntityTooLarge (8)
- HTTPRequestHeaderFieldsTooLarge (8)
- HTTPRequestTimeOut (8)
- HTTPRequestTimeout (3)
- HTTPRequestURITooLarge (8)
- HTTPRequestURITooLong (8)
- HTTPRequestedRangeNotSatisfiable (8)
- HTTPResetContent (8)
- HTTPResponse (8)
- HTTPRetriableError (8)
- HTTPSeeOther (8)
- HTTPServerError (8)
- HTTPServerException (8)
- HTTPServiceUnavailable (8)
- HTTPSession (8)
- HTTPSuccess (8)
- HTTPSwitchProtocol (8)
- HTTPTemporaryRedirect (8)
- HTTPTooManyRequests (8)
- HTTPURITooLong (3)
- HTTPUnavailableForLegalReasons (5)
- HTTPUnknownResponse (8)
- HTTPUnprocessableEntity (8)
- HTTPUnsupportedMediaType (8)
- HTTPUpgradeRequired (8)
- HTTPUseProxy (8)
- HTTPVariantAlsoNegotiates (4)
- HTTPVersionNotSupported (8)
- Head (8)
- Lock (8)
- Mkcol (8)
- Move (8)
- Options (8)
- Patch (8)
- Post (8)
- Propfind (8)
- Proppatch (8)
- Proxy (8)
- Put (8)
- Trace (8)
- Unlock (8)
- [] (8)
- []= (8)
- active? (8)
-
add
_ field (8) - address (8)
-
basic
_ auth (8) - body (16)
- body= (8)
-
body
_ exist? (8) -
body
_ permitted? (8) -
body
_ stream (8) -
body
_ stream= (8) -
ca
_ file (8) -
ca
_ file= (8) -
ca
_ path (8) -
ca
_ path= (8) -
canonical
_ each (8) - cert (8)
- cert= (8)
-
cert
_ store (8) -
cert
_ store= (8) - chunked? (8)
- ciphers (8)
- ciphers= (8)
-
close
_ on _ empty _ response (8) -
close
_ on _ empty _ response= (8) - code (8)
-
content
_ length (8) -
content
_ length= (8) -
content
_ range (8) -
content
_ type (8) -
content
_ type= (8) -
continue
_ timeout (8) -
continue
_ timeout= (8) - copy (8)
-
default
_ port (8) - delete (16)
- each (8)
-
each
_ capitalized (8) -
each
_ capitalized _ name (8) -
each
_ header (8) -
each
_ key (8) -
each
_ name (8) -
each
_ value (8) - entity (8)
- fetch (24)
- finish (8)
-
form
_ data= (8) - get (32)
- get2 (16)
-
get
_ fields (8) -
get
_ print (16) -
get
_ response (16) - head (8)
- head2 (16)
- header (8)
-
http
_ default _ port (8) -
http
_ version (8) -
https
_ default _ port (8) -
is
_ version _ 1 _ 1? (8) -
is
_ version _ 1 _ 2? (8) -
keep
_ alive _ timeout (8) -
keep
_ alive _ timeout= (8) - key (8)
- key= (8)
- key? (8)
- length (8)
-
local
_ host (8) -
local
_ host= (8) -
local
_ port (8) -
local
_ port= (8) - lock (8)
-
main
_ type (8) - method (16)
- mkcol (8)
- move (8)
- msg (8)
- new (16)
-
open
_ timeout (8) -
open
_ timeout= (8) - patch (16)
- path (8)
-
peer
_ cert (8) - port (8)
- post (16)
- post2 (16)
-
post
_ form (8) - propfind (8)
- proppatch (8)
- proxy? (8)
-
proxy
_ address (16) -
proxy
_ address= (8) -
proxy
_ basic _ auth (8) -
proxy
_ class? (8) -
proxy
_ from _ env= (8) -
proxy
_ from _ env? (8) -
proxy
_ pass (16) -
proxy
_ pass= (8) -
proxy
_ port (16) -
proxy
_ port= (8) -
proxy
_ uri (8) -
proxy
_ user (16) -
proxy
_ user= (8) - proxyaddr (8)
- proxyport (8)
- put (8)
- put2 (16)
- range (8)
- range= (16)
-
range
_ length (8) -
read
_ body (16) -
read
_ timeout (8) -
read
_ timeout= (8) -
reader
_ header (8) - request (16)
-
request
_ body _ permitted? (8) -
request
_ get (16) -
request
_ head (16) -
request
_ post (16) -
request
_ put (16) - response (16)
-
response
_ body _ permitted? (8) -
send
_ request (8) -
set
_ content _ type (8) -
set
_ debug _ output (8) -
set
_ form _ data (8) -
set
_ range (24) - size (8)
-
ssl
_ timeout (8) -
ssl
_ timeout= (8) -
ssl
_ version (8) -
ssl
_ version= (8) - start (32)
- started? (8)
-
sub
_ type (8) - trace (8)
-
type
_ params (8) - unlock (8)
-
use
_ ssl= (8) -
use
_ ssl? (8) - value (8)
-
verify
_ callback (8) -
verify
_ callback= (8) -
verify
_ depth (8) -
verify
_ depth= (8) -
verify
_ mode (8) -
verify
_ mode= (8) -
version
_ 1 _ 1? (8) -
version
_ 1 _ 2 (8) -
version
_ 1 _ 2? (8) -
write
_ timeout (3) -
write
_ timeout= (3)
検索結果
先頭5件
-
Net
:: HTTPHeader # fetch(key) -> String (8026.0) -
key ヘッダフィールドを返します。
...key が存在する][ruby]{
require 'net/http'
uri = URI.parse('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......efault を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa... -
Net
:: HTTPHeader # fetch(key) {|hash| . . . . } -> String (8026.0) -
key ヘッダフィールドを返します。
...key が存在する][ruby]{
require 'net/http'
uri = URI.parse('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......efault を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa... -
Net
:: HTTPHeader # fetch(key , default) -> String (8026.0) -
key ヘッダフィールドを返します。
...key が存在する][ruby]{
require 'net/http'
uri = URI.parse('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......efault を指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.fetch("content-length", "default") # => "default"
//}
//emlist[例 key とブロックを指定][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa... -
Net
:: HTTPResponse # value -> nil (8020.0) -
レスポンスが 2xx(成功)でなかった場合に、対応する 例外を発生させます。
...スが 2xx(成功)でなかった場合に、対応する
例外を発生させます。
@raise HTTPError レスポンスが 1xx であるか、 net/http が知らない
種類のレスポンスである場合に発生します。
@raise HTTPRetriableError レスポンスが 3xx......レスポンスが 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"
respo... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (8014.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...ます。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (8014.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...ます。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
# net/http version 1.1
response, body = http.get( '/index.html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/... -
Net
:: HTTP . Proxy(address , port = 80) -> Class (8014.0) -
Proxy 経由で http サーバに接続するためのクラスを作成し返します。
...ew を使う
require 'net/http'
proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080)
http = proxy_class.new('www.example.org')
http.start {|h|
h.get('/ja/') # proxy.example.com 経由で接続します。
}
例2: Net::HTTP.start を使う
require 'net/http'
proxy_class = Net::... -
Net
:: HTTP . get _ print(host , path , port = 80) -> () (8014.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...ます。
@param port 接続するポートを整数で指定します。
@see Net::HTTP.get
=== 例
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
もしくは
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'... -
Net
:: HTTP . get _ print(uri) -> () (8014.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...ます。
@param port 接続するポートを整数で指定します。
@see Net::HTTP.get
=== 例
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
もしくは
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'... -
Net
:: HTTPHeader # form _ data=(params) (8014.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse... -
Net
:: HTTPHeader # range -> Range|nil (8014.0) -
Range: ヘッダの示す範囲を Range オブジェクトで返します。
...ist[例 正常な値][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "bytes=1-5"
req.range # => [1..5]
//}
//emlist[例 Net::HTTPHeaderSyntaxError][ruby]{
require 'net/http'
uri = URI.parse('http://www.exampl... -
Net
:: HTTPHeader # set _ form _ data(params , sep = & # 39;&& # 39;) -> () (8014.0) -
HTMLのフォームのデータ params から ヘッダフィールドとボディを設定します。
...][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} # => {"q"=>["ruby", "perl"], "lang"=>"en"}
//}
//emlist[例 set_form_data][ruby]{
require 'net/http'
uri = URI.parse... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (8014.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...果取得][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'
uri = URI.parse('http:/...