Skip to main content

status_code_response

Function status_code_response 

Source
pub fn status_code_response(
    status_code: &StatusCode,
    headers: Option<&HashMap<String, Option<String>>>,
    request_headers: &HeaderMap,
) -> Result<Response<BoxBody>, Error>
Expand description

custom status code response (body is empty)

headers are applied last, after the status is set, so an explicit header always wins over anything ResponseHandler would otherwise infer (RFC 045: an explicitly configured header wins over an inferred default).