ライブラリ
-
cgi
/ core (22) -
net
/ http (374) - openssl (11)
-
webrick
/ httpresponse (11) -
webrick
/ httpservlet / abstract (66)
クラス
- CGI (22)
-
Net
:: HTTPGenericRequest (88) -
OpenSSL
:: X509 :: ExtensionFactory (11) -
WEBrick
:: HTTPResponse (11) -
WEBrick
:: HTTPServlet :: AbstractServlet (66)
モジュール
-
Net
:: HTTPHeader (286)
キーワード
- [] (11)
- []= (11)
-
basic
_ auth (11) - body (11)
- body= (11)
-
body
_ stream (11) -
body
_ stream= (11) - chunked= (11)
- chunked? (11)
-
content
_ length (11) -
content
_ length= (11) -
content
_ range (11) -
content
_ type (11) -
content
_ type= (11) - delete (11)
-
do
_ DELETE (11) -
do
_ GET (11) -
do
_ HEAD (11) -
do
_ OPTIONS (11) -
do
_ POST (11) -
do
_ PUT (11) - each (11)
-
each
_ capitalized _ name (11) -
each
_ header (11) -
each
_ key (11) -
each
_ name (11) -
each
_ value (11) - fetch (33)
-
form
_ data= (11) - header (11)
- method (22)
- out (11)
- path (11)
-
proxy
_ basic _ auth (11) - range (11)
-
range
_ length (11) -
request
_ body _ permitted? (11) -
response
_ body _ permitted? (11) -
set
_ content _ type (11) -
set
_ form _ data (11) -
subject
_ request= (11)
検索結果
先頭5件
-
Net
:: HTTPGenericRequest # request _ body _ permitted? -> bool (9138.0) -
リクエストにエンティティボディを一緒に送ることが許されている HTTP メソッド (POST など)の場合真を返します。
...場合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.request_body_permitted? # => true
head = Net::HTTP::Head.new(uri.request_uri)
head.request_body_permitted? # => false
//}... -
OpenSSL
:: X509 :: ExtensionFactory # subject _ request=(req) (6114.0) -
自身に証明書署名要求オブジェクトを設定します。
...自身に証明書署名要求オブジェクトを設定します。
@param req 設定する証明書署名要求(OpenSSL::X509::Request)オブジェクト
@see OpenSSL::X509::ExtensionFactory.new... -
Net
:: HTTPGenericRequest # method -> String (3025.0) -
リクエストの HTTP メソッドを文字列で返します。
...リクエストの HTTP メソッドを文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.method # => "POST"
req = Net::HTTP::Get.new(uri.request_uri)
req.method # => "GET"
//}... -
Net
:: HTTPGenericRequest # response _ body _ permitted? -> bool (3025.0) -
サーバからのレスポンスにエンティティボディを含むことが許されている HTTP メソッド (GET, POST など)の場合真を返します。
...合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.response_body_permitted? # => true
head = Net::HTTP::Head.new(uri.request_uri)
head.response_body_permitted? # => false
//}... -
Net
:: HTTPGenericRequest # body -> String (3013.0) -
サーバに送るリクエストのエンティティボディを返します。
...クエストのエンティティボディを返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data"
req.body # => "Test Post Data"
//}
@see Net::HTTPGenericRequest#body=... -
Net
:: HTTPGenericRequest # body=(body) (3013.0) -
サーバに送るリクエストのエンティティボディを文字列で設定します。
...。
@param body 設定するボディを文字列で与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Post.new(uri.request_uri)
req.body = "Test Post Data" # => "Test Post Data"
//}
@see Net::HTTPGenericRequest#body... -
Net
:: HTTPGenericRequest # body _ stream -> object (3013.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...クトを与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream... -
Net
:: HTTPGenericRequest # body _ stream=(f) (3013.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...クトを与えます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream... -
Net
:: HTTPGenericRequest # path -> String (3013.0) -
リクエストする path を文字列で返します。
...リクエストする path を文字列で返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}... -
WEBrick
:: HTTPServlet :: AbstractServlet # do _ DELETE(request , response) -> () (119.0) -
自身の service メソッドから HTTP のリクエストに応じて 呼ばれるメソッドです。AbstractServlet のサブクラスはこれらのメソッドを適切に実装し なければいけません。返り値は特に規定されていません。
...Brick::HTTPRequest#query, WEBrick::HTTPRequest#body などの
メソッドが読ばれた時点で読み込みが行われます。クライアントから巨大なデータが送られてくることを考慮して
ユーザはプログラミングを行うべきです。
@param request クライ......アントからのリクエストを表す WEBrick::HTTPRequest オブジェクトです。
@param response クライアントへのレスポンスを表す WEBrick::HTTPResponse オブジェクトです。
例:
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',
:Port => 20080})
srv.mount('/', HogeServlet)
trap("INT"){ srv.shutdown }
srv.st...