Documentation
¶
Overview ¶
Package chttp (Cooked HTTP) provides a wrapper around http.Client with cookies. It also allows to use custom Transport, which wraps the default transport and calls the user-defined function before and after the request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithTransport ¶
func NewWithTransport(cookieDomain string, cookies []*http.Cookie, rt http.RoundTripper) (*http.Client, error)
NewWithTransport inits the HTTP client with cookies. It allows to use the custom Transport.
Types ¶
type Transport ¶
type Transport struct { // BeforeReq is called before the request. BeforeReq func(req *http.Request) // AfterReq is called after the request. AfterReq func(resp *http.Response, req *http.Request) // contains filtered or unexported fields }
Transport is a simple wrapper for http.RoundTripper to do something before and after RoundTrip.
func NewTransport ¶
func NewTransport(tr http.RoundTripper) *Transport
NewTransport returns a new Transport.
Click to show internal directories.
Click to hide internal directories.