Documentation ¶
Index ¶
- Constants
- func HTTPGet(queryURL string, params *map[string]string, options ...ClientOption) ([]byte, error)
- func HTTPGetJSON(queryURL string, params *map[string]string, options ...ClientOption) (map[string]interface{}, error)
- func HTTPGetJSONList(queryURL string, params *map[string]interface{}, options ...ClientOption) ([]byte, error)
- func HTTPPostJSON(queryURL string, params map[string]interface{}, options ...ClientOption) (map[string]interface{}, error)
- func HTTPPostJSONEx(queryURL string, params interface{}, result interface{}, ...) error
- func HTTPQuery(method string, queryURL string, body io.Reader, options ...ClientOption) ([]byte, error)
- func HTTPURLRequestWithoutBody(method string, queryURL string, params *map[string]interface{}, ...) ([]byte, error)
- type ClientOption
- func WithHTTPHeader(name, value string) ClientOption
- func WithHTTPHeaders(headers map[string]string) ClientOption
- func WithHTTPHeadersEx(headers map[string]interface{}) ClientOption
- func WithHTTPProxies(proxies *definations.Proxies) ClientOption
- func WithHTTPTLSOptions(tlsOptions *definations.TLSOptions) ClientOption
- func WithRetry(shouldRetryTimes int) ClientOption
- func WithSuccessStatusCodes(codes ...int) ClientOption
- func WithTimeout(timeoutSeconds int) ClientOption
Constants ¶
View Source
const (
RetryDurationFactor = 5
)
Constants
Variables ¶
This section is empty.
Functions ¶
func HTTPGetJSON ¶
func HTTPGetJSON(queryURL string, params *map[string]string, options ...ClientOption) (map[string]interface{}, error)
HTTPGetJSON request and response as json
func HTTPGetJSONList ¶
func HTTPGetJSONList(queryURL string, params *map[string]interface{}, options ...ClientOption) ([]byte, error)
HTTPGetJSONList request get json value list
func HTTPPostJSON ¶
func HTTPPostJSON(queryURL string, params map[string]interface{}, options ...ClientOption) (map[string]interface{}, error)
HTTPPostJSON request and response as json
func HTTPPostJSONEx ¶
func HTTPPostJSONEx(queryURL string, params interface{}, result interface{}, options ...ClientOption) error
HTTPPostJSONEx request and response as json
func HTTPQuery ¶
func HTTPQuery(method string, queryURL string, body io.Reader, options ...ClientOption) ([]byte, error)
HTTPQuery request
func HTTPURLRequestWithoutBody ¶
func HTTPURLRequestWithoutBody(method string, queryURL string, params *map[string]interface{}, options ...ClientOption) ([]byte, error)
HTTPURLRequestWithoutBody URL parameter transfer without body
Types ¶
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption http client option
func WithHTTPHeaders ¶
func WithHTTPHeaders(headers map[string]string) ClientOption
WithHTTPHeaders options
func WithHTTPHeadersEx ¶
func WithHTTPHeadersEx(headers map[string]interface{}) ClientOption
WithHTTPHeadersEx options
func WithHTTPProxies ¶
func WithHTTPProxies(proxies *definations.Proxies) ClientOption
WithHTTPProxies options
func WithHTTPTLSOptions ¶
func WithHTTPTLSOptions(tlsOptions *definations.TLSOptions) ClientOption
WithHTTPTLSOptions options
func WithSuccessStatusCodes ¶
func WithSuccessStatusCodes(codes ...int) ClientOption
WithSuccessStatusCodes options
Click to show internal directories.
Click to hide internal directories.