HTTP response that should be returned to the client.
Contains the content, status, and headers that should be applied to the actual
This type is used to allow the content, status, and headers to be mutated by
ATH::Listeners before being returned to the client.
#content is written all at once to the server response's
Direct known subclasses
.new(content : String | Nil = nil, status : HTTP::Status | Int32 = HTTP::Status::OK, headers : HTTP::Headers | ATH::Response::Headers = ATH::Response::Headers.new)#
Creates a new response with optional content, status, and headers arguments.
#last_modified : Time | ::Nil#
last-modified header if set, otherwise
#last_modified=(time : Time | Nil = nil) : Nil#
last-modified header to the provided time.
Removes the header if time is
#send(request : ATH::Request, response : HTTP::Server::Response) : Nil#
self to the client based on the provided context.
How the content gets written can be customized via an
#set_etag(etag : String | Nil = nil, weak : Bool = false) : Nil#
etag header to the provided, optionally weak, etag.
Removes the header if etag is
#set_public : Nil#
self as "public".
cache-control directive and removes the