種類
- インスタンスメソッド (204)
- ライブラリ (12)
- モジュール関数 (12)
- クラス (12)
ライブラリ
-
net
/ http (72) -
webrick
/ httpauth (12) -
webrick
/ httpauth / basicauth (12) -
webrick
/ httpresponse (60) -
webrick
/ httpservlet / abstract (72)
クラス
-
Net
:: HTTP (48) -
Net
:: HTTPGenericRequest (24) -
WEBrick
:: HTTPResponse (60) -
WEBrick
:: HTTPServlet :: AbstractServlet (72)
モジュール
-
WEBrick
:: HTTPAuth (12)
キーワード
- BasicAuth (12)
-
basic
_ auth (12) - body (12)
- chunked= (12)
-
content
_ length (12) -
content
_ length= (12) -
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) - get (24)
- post (24)
-
to
_ s (12) -
webrick
/ cgi (12)
検索結果
先頭5件
-
WEBrick
:: HTTPAuth :: BasicAuth (6.0) -
HTTP の Basic 認証のためのクラスです。
...passwd(nil, 'username', 'supersecretpass')
authenticator = WEBrick::HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
srv.mount_proc('/basic_auth') {|req, res|
authenticator.authenticate(req, res)
res.body = "hoge"
}
srv.start # http://127.0.0.1:10080/basic_auth... -
WEBrick
:: HTTPResponse # chunked=(flag) (6.0) -
真に設定するとクライアントに返す内容(エンティティボディ)を chunk に分けるようになります。
...分けてクライアントに返します。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
res.chunked = true
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 09:04:28 GMT... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (6.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT... -
WEBrick
:: HTTPResponse # content _ length=(len) (6.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT... -
WEBrick
:: HTTPResponse # to _ s -> String (6.0) -
実際にクライアントに送られるデータを文字列として返します。
...データを文字列として返します。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Len... -
WEBrick
:: HTTPServlet :: AbstractServlet # do _ DELETE(request , response) -> () (6.0) -
自身の service メソッドから HTTP のリクエストに応じて 呼ばれるメソッドです。AbstractServlet のサブクラスはこれらのメソッドを適切に実装し なければいけません。返り値は特に規定されていません。
...ジェクトです。
例:
require 'webrick'
class HogeServlet < WEBrick::HTTPServlet::AbstractServlet
def do_GET(req, res)
res.body = 'hoge'
end
end
srv = WEBrick::HTTPServer.new({ :DocumentRoot => './',
:BindAddress => '127.0.0.1',... -
WEBrick
:: HTTPServlet :: AbstractServlet # do _ GET(request , response) -> () (6.0) -
自身の service メソッドから HTTP のリクエストに応じて 呼ばれるメソッドです。AbstractServlet のサブクラスはこれらのメソッドを適切に実装し なければいけません。返り値は特に規定されていません。
...ジェクトです。
例:
require 'webrick'
class HogeServlet < WEBrick::HTTPServlet::AbstractServlet
def do_GET(req, res)
res.body = 'hoge'
end
end
srv = WEBrick::HTTPServer.new({ :DocumentRoot => './',
:BindAddress => '127.0.0.1',... -
WEBrick
:: HTTPServlet :: AbstractServlet # do _ HEAD(request , response) -> () (6.0) -
自身の service メソッドから HTTP のリクエストに応じて 呼ばれるメソッドです。AbstractServlet のサブクラスはこれらのメソッドを適切に実装し なければいけません。返り値は特に規定されていません。
...ジェクトです。
例:
require 'webrick'
class HogeServlet < WEBrick::HTTPServlet::AbstractServlet
def do_GET(req, res)
res.body = 'hoge'
end
end
srv = WEBrick::HTTPServer.new({ :DocumentRoot => './',
:BindAddress => '127.0.0.1',... -
WEBrick
:: HTTPServlet :: AbstractServlet # do _ OPTIONS(request , response) -> () (6.0) -
自身の service メソッドから HTTP のリクエストに応じて 呼ばれるメソッドです。AbstractServlet のサブクラスはこれらのメソッドを適切に実装し なければいけません。返り値は特に規定されていません。
...ジェクトです。
例:
require 'webrick'
class HogeServlet < WEBrick::HTTPServlet::AbstractServlet
def do_GET(req, res)
res.body = 'hoge'
end
end
srv = WEBrick::HTTPServer.new({ :DocumentRoot => './',
:BindAddress => '127.0.0.1',...