ライブラリ
-
net
/ http (638) -
rubygems
/ remote _ fetcher (11) -
webrick
/ cgi (11) -
webrick
/ httpauth (22) -
webrick
/ httpauth / basicauth (11) -
webrick
/ httpauth / digestauth (22) -
webrick
/ httpproxy (11) -
webrick
/ httpresponse (407) -
webrick
/ httpserver (33) -
webrick
/ httpservlet / abstract (77) -
webrick
/ httpservlet / cgihandler (22) -
webrick
/ httpservlet / erbhandler (22) -
webrick
/ httpservlet / filehandler (77) -
webrick
/ httpservlet / prochandler (33)
クラス
-
Gem
:: RemoteFetcher (11) -
Net
:: HTTP (440) -
Net
:: HTTPResponse (165) -
WEBrick
:: CGI (11) -
WEBrick
:: HTTPAuth :: BasicAuth (11) -
WEBrick
:: HTTPAuth :: DigestAuth (22) -
WEBrick
:: HTTPProxyServer (11) -
WEBrick
:: HTTPResponse (396) -
WEBrick
:: HTTPServer (33) -
WEBrick
:: HTTPServlet :: AbstractServlet (77) -
WEBrick
:: HTTPServlet :: CGIHandler (22) -
WEBrick
:: HTTPServlet :: DefaultFileHandler (33) -
WEBrick
:: HTTPServlet :: ERBHandler (22) -
WEBrick
:: HTTPServlet :: FileHandler (44) -
WEBrick
:: HTTPServlet :: ProcHandler (33)
モジュール
-
Net
:: HTTPExceptions (11) -
WEBrick
:: HTTPAuth (22)
キーワード
-
CODE
_ CLASS _ TO _ OBJ (11) -
CODE
_ TO _ OBJ (11) - HTTPExceptions (11)
-
NEWS for Ruby 2
. 5 . 0 (7) - [] (11)
- []= (11)
- authenticate (22)
-
basic
_ auth (11) - body (22)
- body= (11)
-
body
_ permitted? (11) - challenge (11)
- chunked= (11)
- chunked? (11)
- code (11)
- config (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ type (11) -
content
_ type= (11) - copy (11)
- delete (11)
-
do
_ DELETE (11) -
do
_ GET (66) -
do
_ HEAD (11) -
do
_ OPTIONS (22) -
do
_ POST (55) -
do
_ PUT (11) - each (11)
- entity (11)
- filename (11)
- filename= (11)
- get (22)
- get2 (22)
-
get
_ response (22) - head (11)
- head2 (22)
- header (22)
-
http
_ version (22) -
keep
_ alive (11) -
keep
_ alive= (11) -
keep
_ alive? (11) - lock (11)
-
make
_ partial _ content (11) - mkcol (11)
-
mount
_ proc (22) - move (11)
- msg (11)
-
net
/ http (11) - new (44)
-
not
_ modified? (11) - patch (22)
- post (22)
- post2 (22)
-
post
_ form (11) - propfind (11)
- proppatch (11)
-
proxy
_ basic _ auth (11) - put (11)
- put2 (22)
-
read
_ body (22) -
reader
_ header (11) -
reason
_ phrase (11) -
reason
_ phrase= (11) - request (33)
-
request
_ get (22) -
request
_ head (22) -
request
_ http _ version (11) -
request
_ http _ version= (11) -
request
_ method (11) -
request
_ method= (11) -
request
_ post (22) -
request
_ put (22) -
request
_ uri (11) -
request
_ uri= (11) - response (22)
-
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 9 feature (11) -
send
_ request (11) -
sent
_ size (11) - service (33)
-
set
_ error (11) -
set
_ redirect (11) - status (11)
- status= (11)
-
status
_ line (11) -
to
_ s (11) - trace (11)
- unlock (11)
- value (11)
-
webrick
/ cgi (11) -
webrick
/ httpresponse (11)
検索結果
先頭5件
-
WEBrick
:: HTTPResponse # http _ version -> WEBrick :: HTTPVersion (24235.0) -
レスポンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
...ンスの HTTP のバージョンを表す WEBrick::HTTPVersion オブジェクトを返します。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
p res.http_version.class #=> WEBrick::HTTPVersion
p res.http_version.to_... -
Net
:: HTTPResponse # http _ version -> String (24141.0) -
サーバがサポートしている HTTP のバージョンを文字列で返します。
...サーバがサポートしている HTTP のバージョンを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.http_version # => "1.1"
//}... -
Net
:: HTTPResponse (24048.0) -
HTTP レスポンスを表現するクラスです。 Net::HTTP クラスは実際には HTTPResponse のサブクラスを返します。
...HTTP レスポンスを表現するクラスです。
Net::HTTP クラスは実際には HTTPResponse のサブクラスを返します。... -
WEBrick
:: HTTPResponse (24022.0) -
HTTP のレスポンスを表すためのクラスです。
...HTTP のレスポンスを表すためのクラスです。
通常 WEBrick::HTTPResponse オブジェクトはサーブレットの service メソッドや do_XXX メソッドの
引数として与えられるものであり、ユーザが明示的に生成する必要はありません。... -
WEBrick
:: HTTPResponse # request _ http _ version -> WEBrick :: HTTPVersion (12249.0) -
リクエストの HTTP バージョンを返します。 デフォルトでは自身の WEBrick::HTTPResponse#http_version が使われます。
...リクエストの HTTP バージョンを返します。
デフォルトでは自身の WEBrick::HTTPResponse#http_version が使われます。... -
WEBrick
:: HTTPResponse # request _ http _ version=(ver) (12123.0) -
リクエストの HTTP バージョンをセットします。
...リクエストの HTTP バージョンをセットします。
@param ver リクエストの HTTP バージョンを WEBrick::HTTPVersion オブジェクトで指定します。... -
webrick
/ httpresponse (12016.0) -
HTTP のレスポンスを表すためのクラスを提供するライブラリです。
...HTTP のレスポンスを表すためのクラスを提供するライブラリです。... -
net
/ http (6298.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...データ転送プロトコル HTTP を扱うライブラリです。
実装は 2616 に基きます。
=== 使用例
==== ウェブサーバからドキュメントを得る (GET)
//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/ind......uire 'net/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('/in......Net::HTTP.get_response(URI.parse(uri_str))
case response
when Net::HTTPSuccess
response
when Net::HTTPRedirection
fetch(response['location'], limit - 1)
else
response.value
end
end
print fetch('http://www.example.org')
//}
より詳しくは Net::HTTPResponse、 Net::HTTPSucc... -
WEBrick
:: HTTPResponse . new(config) -> WEBrick :: HTTPResponse (6223.0) -
HTTPResponse オブジェクトを生成して返します。
...
HTTPResponse オブジェクトを生成して返します。
@param config 設定を保存したハッシュを指定します。:HTTPVersion は必須です。
require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )... -
Net
:: HTTPResponse # read _ body {|str| . . . . } -> () (6066.0) -
ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。
...y]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = 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.c......om/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|
response.read_b......い。
dest は obsolete です。使わないでください。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param dest obsoleteな引数です。利用しないでください。
@see Net::HTTP#request_get...