別のキーワード
種類
- 特異メソッド (72)
- インスタンスメソッド (24)
- 文書 (24)
- ライブラリ (12)
ライブラリ
-
net
/ http (48) - uri (36)
-
webrick
/ httpproxy (12)
クラス
-
Net
:: HTTP (24) -
Net
:: HTTPResponse (24) -
URI
:: FTP (12) -
URI
:: Generic (12) -
WEBrick
:: HTTPProxyServer (12)
モジュール
- URI (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
get
_ print (24) -
net
/ http (12) - new (36)
-
read
_ body (24) -
ruby 1
. 8 . 2 feature (12)
検索結果
先頭5件
- URI
. parse(uri _ str) -> object - URI
:: Generic . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , parser = URI :: DEFAULT _ PARSER , arg _ check = false) -> URI :: Generic - Net
:: HTTP . get _ print(host , path , port = 80) -> () - URI
:: FTP . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , arg _ check = false) -> URI :: FTP - net
/ http
-
URI
. parse(uri _ str) -> object (18113.0) -
与えられた URI から該当する URI::Generic のサブクラスのインスタンスを生成して 返します。scheme が指定されていない場合は、URI::Generic オブジェクトを返します。
...失敗した場合に発生します。
例:
require 'uri'
p uri = URI.parse("http://www.ruby-lang.org/")
# => #<URI::HTTP:0x201002a6 URL:http://www.ruby-lang.org/>
p uri.scheme # => "http"
p uri.host # => "www.ruby-lang.org"
p uri.port # => 80
p uri.path # => "/"... -
URI
:: Generic . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , parser = URI :: DEFAULT _ PARSER , arg _ check = false) -> URI :: Generic (307.0) -
各引数を成分とする URI::Generic オブジェクトを生成して返します。
...えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host 構成要素を表す文字列を与えます。
@param port 構成要素を表す文字列を与えます。
@param registry 構成要素を表す文字列を与えます。
@param path 構成要素を表... -
Net
:: HTTP . get _ print(host , path , port = 80) -> () (119.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...(host, path, port) で指定するかのいずれかです。
@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの存在するパスを文字列で指定します。
@param port 接続するポ......ートを整数で指定します。
@see Net::HTTP.get
=== 例
//emlist[][ruby]{
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
//}
もしくは
//emlist[][ruby]{
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'
//}... -
URI
:: FTP . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , arg _ check = false) -> URI :: FTP (113.0) -
汎用的な構成要素から URI::FTP オブジェクトを生成します。build と異なり、デフォルトでは引数の正当性を検査しません。
...クトを生成します。build
と異なり、デフォルトでは引数の正当性を検査しません。
例:
require 'uri'
p ftp = URI.parse("ftp://ftp.ruby-lang.org/pub/ruby/;type=d")
p ftp.typecode
#=> #<URI::FTP:0x2010029c URL:ftp://ftp.ruby-lang.org/pub/ruby/;type=d>
#=> "d"......えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host 構成要素を表す文字列を与えます。
@param port 構成要素を表す文字列を与えます。
@param registry nil を与えます。
@param path 構成要素を表す文字列を与えま... -
net
/ http (78.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'
url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http.get('/index.html')
}
p......emlist[例4: 上の例よりさらに汎用的な例][ruby]{
require 'net/http'
url = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
puts res.body
//}
==== フォームの情報を送信す......'uri'
#例1: POSTするだけ
res = Net::HTTP.post_form(URI.parse('http://www.example.com/search'),
{'q'=>'ruby', 'max'=>'50'})
puts res.body
#例2: 認証付きで POST する
res = Net::HTTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),... -
ruby 1
. 8 . 2 feature (42.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...anges-ruby181_ruby182>))
を参照して下さい。
* rss, rdoc, yaml の変更点は収録していません。
=== 日時未詳
: CGI#server_port [lib] [bug]
常に 0 を返すバグが修正されました。
=== 2004-12-19
: OpenSSL::X509::Store#time= [lib] [new]
: OpenSSL::X5......[new]
追加。
: OpenSSL::X509::Name::RFC2253DN [lib] [new]
module for RFC2253 DN format.
: OpenSSL::X509::Name.parse_rfc2253 [lib] [new]
new method to parse RFC2253 DN format.
=== 2004-12-18
: Object#id [ruby] [obsolete]
常に警告がでるようになりました。Object#o......LV23_PADDING, NO_PADDING and PKCS1_OAEP_PADDING under OpenSSL::PKey::RSA.
=== 2004-12-05
: OptionParser::Completion#complete [lib] [compat]
new parameter to direct case insensitiveness.
: OptionParser#order! [lib] [change]
((<ruby-dev:25048>))
=== 2004-12-04
: NKF.guess [lib] [c... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (24.0) -
プロクシオブジェクトを生成して返します。
...raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyServer.new(ProxyAuthProc: auth_proc, Port: 8080)
//}
: :ProxyContentHandler
接続先の HTTP サーバからの内容を処理する Proc オブジェクトを指定します。
レ....../です。/, 'でんがな。')
res.body.gsub!(/ます。/, 'まんがな。')
}
s = WEBrick::HTTPProxyServer.new(ProxyContentHandler: handler, Port: 8080)
//}
: :ProxyVia
true を指定した場合 接続先の HTTP サーバへのリクエストに Via ヘッダを付けます。デフォ......の Proxy の URI
を URI オブジェクトで指定します。
//emlist{
require 'uri'
require 'webrick/httpproxy'
u = URI.parse('http://localhost:18080/')
s = WEBrick::HTTPProxyServer.new(ProxyURI: u, Port: 8080)
//}
@param default デフォルトは WEBrick::Config::HTTP です。... -
Net
:: HTTP . get _ print(uri) -> () (19.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...(host, path, port) で指定するかのいずれかです。
@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの存在するパスを文字列で指定します。
@param port 接続するポ......ートを整数で指定します。
@see Net::HTTP.get
=== 例
//emlist[][ruby]{
require 'net/http'
require 'uri'
Net::HTTP.get_print URI.parse('http://www.example.com/index.html')
//}
もしくは
//emlist[][ruby]{
require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'
//}... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (18.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}
//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open(...