種類
- 特異メソッド (60)
- インスタンスメソッド (36)
- 文書 (24)
- ライブラリ (12)
クラス
-
Net
:: HTTP (24) -
Net
:: HTTPResponse (24) -
URI
:: FTP (12) -
URI
:: Generic (24)
モジュール
- URI (12)
キーワード
-
get
_ print (24) -
net
/ http (12) - new (24)
-
read
_ body (24) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) - select (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 scheme 構成要素 scheme を表す文字列を与えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host 構成要素を表す文字列を与えます。
@param port 構成要素を表す文字列を与えます。
@param registry 構成要素を表... -
Net
:: HTTP . get _ print(host , path , port = 80) -> () (119.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...tdout に出力します。
対象の指定方法は URI で指定するか、
(host, path, port) で指定するかのいずれかです。
@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの......るポートを整数で指定します。
@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 と異なり、デフォルトでは引数の正当性を検査しません。
...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 scheme 構成要素を表す文字列を与えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host... -
net
/ http (66.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
.../http'
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'......}
//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 からの変更点です。
...[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......EBrick::HTTPResponse#content_length= [lib] [new]
: WEBrick::HTTPResponse#content_type= [lib] [new]
: WEBrick::HTTPUtils.parse_qvalues [lib] [new]
: WEBrick::HTTPServer#virtual_host [lib] [new]
: WEBrick::HTTPServer#lookup_server [lib] [new]
: WEBrick::HTTPServlet::FileHandler#get_servlet [lib] [new]... -
ruby 1
. 6 feature (30.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...7 feature>)) の 2002-06-24 も参照)
p "#{ "" # comment }"
=> ruby 1.6.8 (2002-10-04) [i586-linux]
""
=> -:1: parse error
ruby 1.7.3 (2002-10-04) [i586-linux]
: SizedQueue#deq, #shift
: SizedQueue#enq
追加(push, pop の別名)。これらが定......ruby '-*' -v
=> ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby: invalid option -* (-h will show valid options)
: 2002-05-22 parsedate
バージョンアップ((<ruby-dev:17171>))
: 2002-05-22 -T オプション
ruby のコマンドラインオプション -T の後に......: mutex_m
Fixed for obj.extend(Sync_m) and obj.extend(Mutex_m).((<ruby-dev:13463>))
$ ruby -v -rsocket -rmutex_m -e 's=TCPSocket.new("localhost",25); s.extend(Mutex_m)'
ruby 1.6.4 (2001-06-04) [i386-linux]
/usr/lib/ruby/1.6/mutex_m.rb:104:in `initialize': wrong # of arguments (0 for... -
Net
:: HTTP . get _ print(uri) -> () (19.0) -
指定した対象から HTTP でエンティティボディを取得し、 $stdout に出力します。
...tdout に出力します。
対象の指定方法は URI で指定するか、
(host, path, port) で指定するかのいずれかです。
@param uri データの取得対象を URI で指定します。
@param host 接続先のホストを文字列で指定します。
@param path データの......るポートを整数で指定します。
@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) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...= 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.example.com/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File....