Documentation ¶
Overview ¶
Package httpx provides some functions about http.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFilterededHeaders = []string{"Host", "Connection"}
DefaultFilterededHeaders is the filtered headers.
Functions ¶
func HandleResponse ¶
func HandleResponse(w http.ResponseWriter, resp *http.Response, cb func(http.ResponseWriter)) error
HandleResponse copies the response header and body to w.
cb will be called after copying the response header.
func HandleResponseBody ¶
func HandleResponseBody(w http.ResponseWriter, resp *http.Response) error
HandleResponseBody copies the response body, not contain header, to w.
Types ¶
type Config ¶
type Config struct { Host string // Required Port uint16 // Required Weight int // Optional, Default: 1 }
Config is used to configure and new a http endpoint.
func (Config) NewEndpoint ¶
NewEndpoint returns a new simple endpoint.
For the argument request, it may be one of types:
*http.Request interface{ Request() *http.Request }
Click to show internal directories.
Click to hide internal directories.