Azu::Response
A response is a message sent from a server to a client
Azu:Response represents an interface for all Azu server responses. You can
still use Crystal HTTP::Response class to generete response messages.
The response #status and #headers must be configured before writing the response body.
Once response output is written, changing the #status and #headers properties has no effect.
Defining Responses
module MyApp
class Home::Page
include Response::Html
TEMPLATE_PATH = "home/index.jinja"
def html
render TEMPLATE_PATH, assigns
end
def assigns
{
"welcome" => "Hello World!",
}
end
end
end
Instance methods
render
SourceNested types
- Azu::Response::AuthenticationError
- Azu::Response::AuthorizationError
- Azu::Response::BadRequest
- Azu::Response::DatabaseError
- Azu::Response::Empty
- Azu::Response::Error
- Azu::Response::ExternalServiceError
- Azu::Response::Forbidden
- Azu::Response::NotFound
- Azu::Response::RateLimitError
- Azu::Response::TimeoutError
- Azu::Response::ValidationError