別のキーワード
種類
- インスタンスメソッド (852)
- クラス (209)
- 特異メソッド (156)
クラス
-
Net
:: HTTP (528) -
Net
:: HTTPGenericRequest (108) -
Net
:: HTTPResponse (84)
モジュール
-
Net
:: HTTPHeader (288)
キーワード
- Get (12)
- HTTPBadGateway (12)
- HTTPGatewayTimeOut (12)
- HTTPGatewayTimeout (7)
- HTTPGenericRequest (12)
- HTTPGone (12)
- HTTPInsufficientStorage (12)
- HTTPLengthRequired (12)
- HTTPPayloadTooLarge (7)
- HTTPProcessing (8)
- HTTPRangeNotSatisfiable (7)
- HTTPRequestEntityTooLarge (12)
- HTTPRequestHeaderFieldsTooLarge (12)
- HTTPRequestURITooLarge (12)
- HTTPRequestURITooLong (12)
- HTTPRequestedRangeNotSatisfiable (12)
- HTTPURITooLong (7)
- HTTPUnavailableForLegalReasons (9)
- HTTPUpgradeRequired (12)
- HTTPVariantAlsoNegotiates (8)
- [] (12)
- address (12)
-
basic
_ auth (12) - body (24)
- body= (12)
-
body
_ exist? (12) -
body
_ stream (12) -
body
_ stream= (12) -
ca
_ file (12) -
ca
_ path (12) - ciphers (12)
- code (12)
-
content
_ length (12) -
content
_ length= (12) -
content
_ range (12) -
content
_ type (12) -
continue
_ timeout (12) -
default
_ port (12) - delete (12)
- entity (12)
- fetch (36)
- get (48)
- get2 (24)
-
get
_ fields (12) -
get
_ print (24) -
get
_ response (24) -
http
_ default _ port (12) -
http
_ version (12) -
https
_ default _ port (12) -
keep
_ alive _ timeout (12) - length (12)
-
local
_ host (12) -
local
_ port (12) -
main
_ type (12) - method (24)
- msg (12)
-
open
_ timeout (12) - patch (12)
- path (12)
- port (12)
- post (12)
-
proxy
_ address (24) -
proxy
_ basic _ auth (12) -
proxy
_ pass (24) -
proxy
_ port (24) -
proxy
_ uri (12) -
proxy
_ user (24) - proxyaddr (12)
- proxyport (12)
- range (12)
- range= (24)
-
range
_ length (12) -
read
_ body (12) -
read
_ timeout (12) -
request
_ body _ permitted? (12) -
request
_ get (24) -
response
_ body _ permitted? (12) -
set
_ debug _ output (12) -
set
_ range (36) - size (12)
-
ssl
_ timeout (12) -
ssl
_ version (12) -
sub
_ type (12) -
verify
_ depth (12) -
verify
_ mode (12)
検索結果
先頭5件
-
Net
:: HTTPHeader # content _ range -> Range|nil (6202.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...Content-Range: ヘッダフィールドの値を Range で返します。
Range の表わす長さは Net::HTTPHeader#range_length で得られます。
ヘッダが設定されていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.exa......mple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
Net
:: HTTPHeader # range -> Range|nil (6202.0) -
Range: ヘッダの示す範囲を Range オブジェクトで返します。
...Range: ヘッダの示す範囲を Range オブジェクトで返します。
ヘッダにない場合は nil を返します。
@raise Net::HTTPHeaderSyntaxError Range:ヘッダの中身が規格通り
でない場合に発生します。
//emlist[例 正常な......'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.example.com/index.html')
req = Net::HTTP::G......et.new(uri.request_uri)
req['range'] = "invalid"
req.range # => Net::HTTPHeaderSyntaxError
//}... -
Net
:: HTTPHeader # range _ length -> Integer|nil (6202.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
...Content-Range: ヘッダフィールドの表している長さを整数で返します。
ヘッダが設定されていない場合には nil を返します。
@raise Net::HTTPHeaderSyntaxError Content-Range: ヘッダフィールド
の値が不正である......発生します。
//emlist[例][ruby]{
require '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
:: HTTPResponse # msg -> String (6202.0) -
HTTP サーバがリザルトコードに付加して返すメッセージです。 例えば 'Not Found' などです。
...して返すメッセージです。
例えば 'Not Found' などです。
msg は obsolete です。使わないでください。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.message # => "OK"
//}... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (6102.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...[例][ruby]{
# 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('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', n......il) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (6102.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...[例][ruby]{
# 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('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', n......il) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get2(path , header = nil) -> Net :: HTTPResponse (6102.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...onse = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}
get2 は時代遅れ......なので使わないでください。
@see Net::HTTP#get, Net::HTTPResponse#read_body... -
Net
:: HTTP # get2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (6102.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...onse = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}
get2 は時代遅れ......なので使わないでください。
@see Net::HTTP#get, Net::HTTPResponse#read_body... -
Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse (6102.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...onse = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read
# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}
get2 は時代遅れ......なので使わないでください。
@see Net::HTTP#get, Net::HTTPResponse#read_body...