Versions in this module Expand all Collapse all v1 v1.1.0 Jun 16, 2023 v1.0.2 Jun 16, 2023 Changes in this version + var FormContentType = "application/x-www-form-urlencoded" + var HdrAcceptKey = http.CanonicalHeaderKey("Accept") + var HdrAuthorizationKey = http.CanonicalHeaderKey("Authorization") + var HdrContentEncodingKey = http.CanonicalHeaderKey("Content-Encoding") + var HdrContentLengthKey = http.CanonicalHeaderKey("Content-Length") + var HdrContentTypeKey = http.CanonicalHeaderKey("Content-Type") + var HdrUserAgentKey = http.CanonicalHeaderKey("User-Agent") + var JSONContentType = "application/json" + var PlainTextType = "text/plain; charset=utf-8" + type HTTPClient struct + func New() *HTTPClient + func NewByApiKey(apiKey string) *HTTPClient + func NewHTTPClient(transport *http.Transport) *HTTPClient + func (hc *HTTPClient) OnAfterResponseHook(f resty.ResponseMiddleware) *HTTPClient + func (hc *HTTPClient) OnBeforeRequestHook(f resty.RequestMiddleware) *HTTPClient + func (hc *HTTPClient) Request() *HTTPRequest + func (hc *HTTPClient) SetDebug(d bool) *HTTPClient + func (hc *HTTPClient) SetFormData(data map[string]string) *HTTPClient + func (hc *HTTPClient) SetHeader(header, value string) *HTTPClient + func (hc *HTTPClient) SetHeaders(headers map[string]string) *HTTPClient + func (hc *HTTPClient) SetHostURL(url string) *HTTPClient + func (hc *HTTPClient) SetLogger(l resty.Logger) *HTTPClient + func (hc *HTTPClient) SetPathParams(params map[string]string) *HTTPClient + func (hc *HTTPClient) SetPreRequestHook(f resty.PreRequestHook) *HTTPClient + func (hc *HTTPClient) SetQueryParam(param, value string) *HTTPClient + func (hc *HTTPClient) SetQueryParams(params map[string]string) *HTTPClient + func (hc *HTTPClient) SetTimeout(timeout time.Duration) *HTTPClient + func (hc *HTTPClient) SetTransport(transport *http.Transport) *HTTPClient + type HTTPRequest struct + func (hr *HTTPRequest) EnableLogging() *HTTPRequest + func (hr *HTTPRequest) EnableTrace() *HTTPRequest + func (hr *HTTPRequest) Get(url string) (*resty.Response, error) + func (hr *HTTPRequest) OnAfterResponseHook(f resty.ResponseMiddleware) *HTTPRequest + func (hr *HTTPRequest) Post(url string) (*resty.Response, error) + func (hr *HTTPRequest) SetBody(body interface{}) *HTTPRequest + func (hr *HTTPRequest) SetContentLength(l bool) *HTTPRequest + func (hr *HTTPRequest) SetFile(filename, filepath string) *HTTPRequest + func (hr *HTTPRequest) SetFiles(files map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetFormData(data map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetHeader(header, value string) *HTTPRequest + func (hr *HTTPRequest) SetHeaderV2(header, value string) *HTTPRequest + func (hr *HTTPRequest) SetHeaders(headers map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetHeadersV2(headers map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetPathParams(params map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetQueryParam(param, value string) *HTTPRequest + func (hr *HTTPRequest) SetQueryParams(params map[string]string) *HTTPRequest + func (hr *HTTPRequest) SetResult(res interface{}) *HTTPRequest + func (hr *HTTPRequest) TraceInfo() resty.TraceInfo + type RequestTimeRecord struct