るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.042秒)
トップページ > クエリ:String[x] > クエリ:hash[x] > クエリ:open_uri[x]

別のキーワード

  1. _builtin hash
  2. matrix hash
  3. hash []
  4. dbm to_hash
  5. _builtin to_hash

ライブラリ

モジュール

検索結果

OpenURI.open_uri(name, mode = 'r', perm = nil, options = {}) -> StringIO (18226.0)

URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。

... StringIO オブジェクト
として返します。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返します。

require '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_authe...
..._proc」と「:progress_proc」はプログレスバーに
利用されることを想定しています。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com',
{ :proxy => 'http://proxy.example.com:8000/',
:http_basic_authentic...