httpclient

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPGet

func HTTPGet(queryURL string, params *map[string]string, options ...ClientOption) ([]byte, error)

HTTPGet request

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

Types

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption http client option

func WithHTTPHeader

func WithHTTPHeader(name, value string) ClientOption

WithHTTPHeader options

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL