55件ヒット
[1-55件を表示]
(0.109秒)
クラス
-
Net
:: HTTPResponse (22) -
URI
:: Generic (33)
キーワード
-
default
_ port (11) - port= (11)
-
read
_ body (22)
検索結果
先頭5件
-
URI
:: Generic # port -> String | nil (29118.0) -
自身の port を文字列で返します。設定されていない場合は nil を返します。
...自身の port を文字列で返します。設定されていない場合は nil を返します。... -
URI
:: Generic # port=(s) (17142.0) -
自身の port を設定します。
...自身の port を設定します。
@param s 自身の port を表す文字列か整数を指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
@raise URI::InvalidURIError port と registry を同時に設定した場合に発生します。... -
URI
:: Generic # default _ port -> Integer | nil (17130.0) -
self.class.default_port を返します。
...self.class.default_port を返します。
@see URI::Generic.default_port... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (55.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://www.exampl.......com/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read... -
Net
:: HTTPResponse # read _ body(dest=nil) -> String|nil (55.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://www.exampl.......com/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read...