Documentation ¶
Index ¶
- func RequestURI(r *http.Request) string
- func RespondWithError(w http.ResponseWriter, statusCode int)
- func RespondWithErrorAndMessage(w http.ResponseWriter, statusCode int, message string)
- func RespondWithRedirect(w http.ResponseWriter, statusCode int, location string)
- func SetRequestURI(r *http.Request, uri string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestURI ¶
RequestURI returns the path and query string (if present) from the request For example: `/foo` or `/foo?hello=world`
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, statusCode int)
RespondWithError responds to a http.ResponseWriter with an error status code. The text corresponding to the status code is sent as body of the response. This method should be invoked before calling w.WriteHeader, and callers should abort the request after calling this method.
func RespondWithErrorAndMessage ¶
func RespondWithErrorAndMessage(w http.ResponseWriter, statusCode int, message string)
RespondWithErrorAndMessage responds to a http.ResponseWriter with an error status code. The message is included in the body as response. This method should be invoked before calling w.WriteHeader, and callers should abort the request after calling this method.
func RespondWithRedirect ¶
func RespondWithRedirect(w http.ResponseWriter, statusCode int, location string)
RespondWithRedirect responds to a http.ResponseWriter with a redirect. This method should be invoked before calling w.WriteHeader, and callers should abort the request after calling this method.
Types ¶
This section is empty.