class Protocol::HTTP::Response
def self.[](status, _headers = nil, _body = nil, headers: _headers, body: _body, protocol: nil)
@parameter headers [Hash] The headers, e.g. `{"content-type" => "text/html"}`, etc.
@parameter status [Integer] The HTTP status code, e.g. `200`, `404`, etc.
~~~
Response[200, {"content-type" => "text/html"}, ["Hello, World!"]]
~~~ ruby
A short-cut method which exposes the main response variables that you'd typically care about. It follows the same order as the `Rack` response tuple, but also includes the protocol.
def self.[](status, _headers = nil, _body = nil, headers: _headers, body: _body, protocol: nil) body = Body::Buffered.wrap(body) headers = Headers[headers] self.new(nil, status, headers, body, protocol) end