るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. module >
  5. integer >

ライブラリ

検索結果

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

URI である文字列 name のリソースを取得して 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 を与えます。理解する...
...ことを想定しています。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com',
{ :proxy => 'http://proxy.example.com:8000/',
:http_basic_authentication => [username, password] })

: :proxy
プロクシの設定をしま...
...gumentError が発生します。

使い方:
//emlist{
:proxy_http_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "proxy-password"]
:proxy_http_basic_authentication =>
[URI.parse("http://proxy.example.com:8000/"), "proxy-user", "proxy-password"]
//}

: :re...

OpenURI.open_uri(name, mode = 'r', perm = nil, options = {}) {|sio| ... } -> nil (101.0)

URI である文字列 name のリソースを取得して 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 を与えます。理解する...
...ことを想定しています。

require 'open-uri'
sio = OpenURI.open_uri('http://www.example.com',
{ :proxy => 'http://proxy.example.com:8000/',
:http_basic_authentication => [username, password] })

: :proxy
プロクシの設定をしま...
...gumentError が発生します。

使い方:
//emlist{
:proxy_http_basic_authentication =>
["http://proxy.example.com:8000/", "proxy-user", "proxy-password"]
:proxy_http_basic_authentication =>
[URI.parse("http://proxy.example.com:8000/"), "proxy-user", "proxy-password"]
//}

: :re...