別のキーワード
クラス
-
Net
:: HTTP (165) -
Net
:: HTTPGenericRequest (33) -
Net
:: HTTPResponse (99)
モジュール
-
Net
:: HTTPExceptions (11) -
Net
:: HTTPHeader (341)
キーワード
- [] (11)
- []= (11)
-
add
_ field (11) -
basic
_ auth (11) - body (11)
- chunked? (11)
- code (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type= (11) - delete (11)
- each (11)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - entity (11)
- fetch (33)
-
form
_ data= (11) - get2 (22)
-
get
_ fields (11) - head2 (22)
-
http
_ version (11) - key? (11)
-
local
_ host= (11) -
local
_ port= (11) -
main
_ type (11) - method (22)
- msg (11)
- path (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
read
_ body (22) - request (22)
-
request
_ get (22) -
request
_ head (22) - response (11)
-
response
_ body _ permitted? (11) -
send
_ request (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
sub
_ type (11) -
type
_ params (11) - value (11)
検索結果
先頭5件
- Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse - Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # get2(path , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # get2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse
-
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (21235.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......Net::HTTPResponse オブジェクトは有効な body を
持ちません。
dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path 取......得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
また、... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (21235.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......Net::HTTPResponse オブジェクトは有効な body を
持ちません。
dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path 取......得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定します。
@param dest 利用しないでください。
1.1 互換モードの場合は、レスポンスに応じて例外が発生します。
また、... -
Net
:: HTTP # get2(path , header = nil) -> Net :: HTTPResponse (9243.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティティ......@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = 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... -
Net
:: HTTP # get2(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (9243.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティティ......@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = 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... -
Net
:: HTTP # request _ get(path , header = nil) -> Net :: HTTPResponse (9243.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティティ......@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = 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... -
Net
:: HTTP # request _ get(path , header = nil) {|response| . . . . } -> Net :: HTTPResponse (9243.0) -
サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。
...サーバ上の path にあるエンティティを取得します。
Net::HTTPResponse オブジェクトを返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......続を維持した状態で Net::HTTPResponse
オブジェクトをブロックに渡します。
大きなサイズのボディを一度に読みだすとまずく、
小さなサイズに分けて取りだしたい場合にはこれを利用します。
@param path 取得するエンティティ......@param header リクエストの HTTP ヘッダをハッシュで指定します。
//emlist[例][ruby]{
# example
response = 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... -
Net
:: HTTPHeader # get _ fields(key) -> [String] (9116.0) -
key ヘッダフィールドの値 (文字列) を配列で返します。
...ん。
@param key ヘッダフィール名を文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.get_fields('accept-ranges') # => ["none"]
//}
@see Net::HTTPHeader#[] , Net::HTTPHeader#[]=,......Net::HTTPHeader#add_field... -
Net
:: HTTP # local _ port=(port) (6215.0) -
接続に用いるローカルポートを設定します。
...@param port ローカルポート(数値、もしくはサービス名文字列)
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_port=, N......et::HTTP#local_host
@see Net::HTTP.new... -
Net
:: HTTPExceptions # response -> Net :: HTTPResponse (6209.0) -
例外の原因となったレスポンスオブジェクトを返します。
...レスポンスオブジェクトを返します。
//emlist[例][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.response # => #<Net::HTTPNotFound 404 Not Found readbody=true>
end
//}... -
Net
:: HTTPHeader # content _ type=(type) (6209.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"
//}...