Skip to main content

Module util

Module util 

Source

Re-exports§

pub use crate::mime::detect_content_type;

Functions§

canonical_header_key
Return a header key in canonical form.
error
Write a plain-text error response. Port of Go’s http.Error.
not_found
Reply with 404 Not Found. Port of Go’s http.NotFound.
parse_time
Parse an HTTP-date string in any of the three formats Go accepts: RFC 1123 (“Mon, 02 Jan 2006 15:04:05 GMT”), RFC 850 (“Monday, 02-Jan-06 15:04:05 GMT”), asctime (“Mon Jan 2 15:04:05 2006”).
redirect
Reply with a redirect to url. Port of Go’s http.Redirect.
set_cookie
Append a Set-Cookie header to the response. Port of Go’s http.SetCookie.