Versions in this module Expand all Collapse all v1 v1.0.0 Feb 26, 2020 Changes in this version + const EncodingForm + const EncodingJSON + const EncodingXML + var DefaultClient = New() + var HttpClient = &http.Client + var HttpTransport = &http.Transport + var InsecureHttpClient = &http.Client + var InsecureHttpTransport = &http.Transport + var InsecureTlsConfig = &tls.Config + var RateLimitTimeoutError = errors.New("HTTPClient rate limit timeout") + var XmlHeaderBytes []byte = []byte(xml.Header) + func EscapePath(path string) string + func IsInvalidStatusCode(err error, statusCode int) bool + type Encoding string + type ErrorHandlerFunc func(*http.Response, error) error + type HTTPClient struct + BaseURL *url.URL + Client *http.Client + Headers http.Header + PostHooks map[int]PostHookFunc + func Insecure() (httpClient *HTTPClient) + func New() (httpClient *HTTPClient) + func (c *HTTPClient) Request(req *RequestData) (response *http.Response, err error) + func (c *HTTPClient) SetErrorHandler(handler ErrorHandlerFunc) + func (c *HTTPClient) SetPostHook(onStatus int, hook PostHookFunc) + func (c *HTTPClient) SetRateLimit(limit int, timeout time.Duration) + type InvalidStatusError struct + Content string + Expected []int + Got int + Headers http.Header + func IsInvalidStatusError(err error) (invalidStatusError *InvalidStatusError, ok bool) + func (e InvalidStatusError) Error() string + type PostHookFunc func(*http.Request, *http.Response) error + type RequestData struct + Context context.Context + ExpectedStatus []int + FullURL string + Headers http.Header + IgnoreRedirects bool + Method string + Params url.Values + Path string + ReqContentLength int64 + ReqEncoding Encoding + ReqReader io.Reader + ReqValue interface{} + RespConsume bool + RespEncoding Encoding + RespValue interface{} + func (r *RequestData) CanCopy() bool + func (r *RequestData) Copy() (ok bool, nr *RequestData) + func (req *RequestData) UploadFile(fieldName string, fileName string, reader io.Reader) (err error) + func (req *RequestData) UploadFileExtra(fieldName string, fileName string, reader io.Reader, extra map[string]string) (err error)