class Protocol::HTTP::Request

def self.[](method, path, headers, body)

def self.[](method, path, headers, body)
	body = Body::Buffered.wrap(body)
	headers = ::Protocol::HTTP::Headers[headers]
	
	self.new(nil, nil, method, path, nil, headers, body)
end

def call(connection)

Send the request to the given connection.
def call(connection)
	connection.call(self)
end

def connect?

def connect?
	@method == Methods::CONNECT
end

def head?

def head?
	@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 = Headers.new, body = nil, protocol = nil)

def initialize(scheme = nil, authority = nil, method = nil, path = nil, version = nil, headers = Headers.new, 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