るりまサーチ

最速Rubyリファレンスマニュアル検索!
240件ヒット [101-200件を表示] (0.010秒)

別のキーワード

  1. net/http body
  2. httprequest body
  3. httpresponse body
  4. net/http read_body
  5. httpresponse read_body

検索結果

<< < 1 2 3 > >>

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',...
<< < 1 2 3 > >>