howdy/response
helps for Gleams http response type
Functions
pub fn of_bit_string(content: BitString) -> Response(BitBuilder)
Returns a status 200 response with the body of BitString
pub fn of_internal_error(text: String) -> Response(a)
Returns an internal error (status 500) with string content for the body
pub fn of_json(json: Json) -> Response(BitBuilder)
Returns json with the status code 200
pub fn of_not_found(text: String) -> Response(a)
Returns a not found response (404) with response text
pub fn of_string(text: String) -> Response(BitBuilder)
Returns a 200 response with the body from the string type
pub fn with_accepted(response: Response(BitBuilder)) -> Response(
BitBuilder,
)
Sets the resonse status code to 202
pub fn with_content_type(response: Response(BitBuilder), content_type: String) -> Response(
BitBuilder,
)
Sets the content type of the response
pub fn with_created(response: Response(BitBuilder)) -> Response(
BitBuilder,
)
Sets the resonse status code to 201
pub fn with_header(response: Response(BitBuilder), key: String, value: String) -> Response(
BitBuilder,
)
Appends the response headers with a key and value
pub fn with_status(response: Response(a), status: Int) -> Response(
a,
)
Overides the status code of the response