種類
- インスタンスメソッド (84)
- 文書 (57)
- ライブラリ (12)
ライブラリ
-
net
/ http (84)
クラス
-
Net
:: HTTP (72)
モジュール
-
Net
:: HTTPHeader (12)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) -
content
_ type (12) - post (24)
- post2 (24)
-
request
_ post (24) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12)
検索結果
先頭5件
- net
/ http - Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse - Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse - Net
:: HTTP # post2(path , data , header = nil) -> Net :: HTTPResponse - Net
:: HTTP # post2(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse
-
net
/ http (38090.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...y]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/index.html')
//}
//emlist[例2: URI を使う][ruby]{
require 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'ur......{
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
//}
==== フォームの情報を送信する (POST)
//emlist[例][ruby]{
require 'net/http'
require '......TTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),
{'from'=>'2005-01-01', 'to'=>'2005-03-31'})
puts res.body
#例3: より細かく制御する
url = URI.parse('http://www.example.com/todo.cgi')
req = Net::HTTP::Post.new(url.path)
req.basic_auth 'jack',... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) -> Net :: HTTPResponse (8024.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=... -
Net
:: HTTP # post(path , data , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (8024.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。
...//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')
# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=... -
Net
:: HTTP # post2(path , data , header = nil) -> Net :: HTTPResponse (8012.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...ないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response... -
Net
:: HTTP # post2(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (8012.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...ないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response... -
Net
:: HTTP # request _ post(path , data , header = nil) -> Net :: HTTPResponse (8012.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...ないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response... -
Net
:: HTTP # request _ post(path , data , header = nil) {|response| . . . . } -> Net :: HTTPResponse (8012.0) -
サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。
...ないでください。
//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read
# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response... -
Net
:: HTTPHeader # content _ type -> String|nil (8012.0) -
"text/html" のような Content-Type を表す 文字列を返します。
...ent-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post.new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/fo... -
ruby 1
. 6 feature (48.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...IO#write
ソケットやパイプに対する EPIPE の検出に失敗することがありました。
((<ruby-dev:16849>))
: 2002-04-11: ((<"cgi/session">)) (*ドキュメント未反映*)
support for multipart form.
: 2002-04-10: Object#((<Object/remove_instance_variable>))
指定......(2002-03-01) [i586-linux]
1
1
=> ruby 1.6.7 (2002-03-29) [i586-linux]
2
2
: 2002-03-22 ((<"net/http">))
Net::HTTP.new がブロックなしのときに nil を返していました。
((<ruby-bugs-ja:PR#214>))
net/protocol は削除さ......と一度ハマッたので書いておきま
す)。
== 1.6.5 (2001-09-19) -> 1.6.6 (2001-09-19)
: ((<Syslog>))
追加されました。
: CGI
Netscape(バージョンは?) のバグに対処しました
((<ruby-list:32089>))
: Time#localtime
: Time#gmtime
フリーズした Time...