Response
Including Response
struct MyResponse
include Azu::Response
def initialize(@data : MyData)
end
def render
@data.to_json
end
endRequired Methods
render
def render : String
{id: @user.id, name: @user.name}.to_json
endBuilt-in Response Types
Azu::Response::Json
Azu::Response::Text
Azu::Response::Html
Azu::Response::Empty
Error Responses
Azu::Response::Error
Built-in Errors
Class
Status
Usage
Using Error Responses
ValidationError
Custom Response Example
Response with Headers
Response with Status
Streaming Responses
Content Negotiation
See Also
Last updated
Was this helpful?
