33件ヒット
[1-33件を表示]
(0.042秒)
別のキーワード
検索結果
先頭3件
-
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO (18376.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...quire 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts sio.read
OpenURI.open_uri('http://www.example.com'){|sio| sio.read }
options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progress_proc
*......:content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定してい......ample.com:8000/"), "proxy-user", "proxy-password"]
//}
: :read_timeout
http コネクションのタイムアウト秒数を指定します。nil でタイムアウトなしを
指定できます。
: :ssl_ca_cert
SSL の CA 証明書を指定します。これを指定した場合は OpenSSL... -
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|sio| . . . } -> nil (18376.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...quire 'open-uri'
sio = OpenURI.open_uri('http://www.example.com')
p sio.last_modified
puts sio.read
OpenURI.open_uri('http://www.example.com'){|sio| sio.read }
options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progress_proc
*......:content_length_proc
* :http_basic_authentication
* :proxy_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定してい......ample.com:8000/"), "proxy-user", "proxy-password"]
//}
: :read_timeout
http コネクションのタイムアウト秒数を指定します。nil でタイムアウトなしを
指定できます。
: :ssl_ca_cert
SSL の CA 証明書を指定します。これを指定した場合は OpenSSL... -
OpenURI
:: Meta # meta -> Hash (6026.0) -
ヘッダを収録したハッシュを返します。
...す。
//emlist[例][ruby]{
require 'open-uri'
open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=......。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"...