Http module

bytes_response

procedure · 1 overloadSource

Raw bytes (a [] u8 or a string) with a content type of your choice. The bytes must stay valid until the response is written.

bytes_response :: (body: $T, content_type: string, status := 200) -> Response

Raw bytes (a [] u8 or a string) with a content type of your choice. The bytes must stay valid until the response is written.

Parameters

body: $T
a [] u8 or a string, sent as it is.
content_type: string
the Content-Type header value.
status := 200
the HTTP status code.

Returns

See also