Documentation
¶
Overview ¶
Package httpx provides a replacement for the standard library's Redirect functions for use in Lindenii projects which require strict paths that do not rely on coalescing // to /.
This is not a drop-in replacement for general use; Redirect panics on relative paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Redirect ¶
Redirect replies to the request with a redirect to url, which must be either a absolute or a root-relative path. Any non-ASCII characters in url will be percent-encoded, but existing percent encodings will not be changed. Unlike the standard library's implementation, double-slashes are not coalesced to single slashes, as they are semantically different.
The provided code should be in the 3xx range and is usually [StatusMovedPermanently], [StatusFound] or [StatusSeeOther].
If the Content-Type header has not been set, Redirect sets it to "text/html; charset=utf-8" and writes a small HTML body. Setting the Content-Type header to any value, including nil, disables that behavior.
Types ¶
This section is empty.