class Protocol::HTTP::Request
def self.[](method, path, headers, body)
def self.[](method, path, headers, body) body = Body::Buffered.wrap(body) self.new(nil, nil, method, path, nil, headers, body) end
def call(connection)
def call(connection) connection.call(self) end
def connect?
def connect? self.method == Methods::CONNECT end
def head?
def head? self.method == Methods::HEAD end
def idempotent?
def idempotent? method != Methods::POST && (body.nil? || body.empty?) end
def initialize(scheme = nil, authority = nil, method = nil, path = nil, version = nil, headers = [], body = nil, protocol = nil)
def initialize(scheme = nil, authority = nil, method = nil, path = nil, version = nil, headers = [], body = nil, protocol = nil) @scheme = scheme @authority = authority @method = method @path = path @version = version @headers = headers @body = body @protocol = protocol end
def to_s
def to_s "#{@scheme}://#{@authority}: #{@method} #{@path} #{@version}" end