Documentation ¶
Index ¶
- func CheckHttpResponseError(resp *http.Response) error
- func DefaultURL(url string, defaultTLS bool) (*neturl.URL, error)
- func RetryableHttpErrorHandler(resp *http.Response, err error, numTries int) (*http.Response, error)
- func ValidateURL(url string) error
- type HttpClient
- type Request
- func (r *Request) AddHeader(key, value string) *Request
- func (r *Request) Do(ctx context.Context) Result
- func (r *Request) GetMethod() string
- func (r *Request) SetBody(bodyType string, body []byte) *Request
- func (r *Request) SetGzip(b bool) *Request
- func (r *Request) SetHeader(key, value string) *Request
- func (r *Request) SetParam(key string, values ...string) *Request
- func (r *Request) SetParamFromQuery(query url.Values) *Request
- func (r *Request) ShallowCopy() *Request
- func (r *Request) URL() *url.URL
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHttpResponseError ¶
func ValidateURL ¶
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(address string, defaultTLS bool, retryMax, retryInterval int) (*HttpClient, error)
func (*HttpClient) Delete ¶
func (c *HttpClient) Delete(path string) *Request
func (*HttpClient) Get ¶
func (c *HttpClient) Get(path string) *Request
func (*HttpClient) Post ¶
func (c *HttpClient) Post(path string) *Request
func (*HttpClient) Put ¶
func (c *HttpClient) Put(path string) *Request
func (*HttpClient) SetDisableKeepAlives ¶
func (c *HttpClient) SetDisableKeepAlives()
func (*HttpClient) SetTLSInsecureSkipVerify ¶
func (c *HttpClient) SetTLSInsecureSkipVerify()
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(c *HttpClient, method, reqPath string) *Request
func (*Request) ShallowCopy ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) StatusCode ¶
Click to show internal directories.
Click to hide internal directories.