Documentation
¶
Overview ¶
Package httputil contains utilities for HTTP clients and servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HopByHopHeaders = []string{
"Connection",
"Keep-Alive",
"Proxy-Authenticate",
"Proxy-Authorization",
"Te",
"Trailers",
"Transfer-Encoding",
"Upgrade",
"Host",
}
HopByHopHeaders are hop-by-hop headers that should not be forwarded by proxies (RFC 7230).
View Source
var TransportHeaders = []string{
"Content-Length",
"Date",
"Accept-Encoding",
"User-Agent",
"Transfer-Encoding",
"Time-To-Live",
}
TransportHeaders are headers added by the HTTP transport layer that should not be cached.
Functions ¶
func ErrorResponse ¶
ErrorResponse creates an error response with the given code and format, and also logs a message.
Types ¶
type HTTPResponder ¶
type HTTPResponder interface {
error
WriteHTTP(http.ResponseWriter, *http.Request)
}
HTTPResponder is an error that knows how to write itself as an HTTP response.
Click to show internal directories.
Click to hide internal directories.