MyGit

v1.0.7

monaco-io/request

版本发布时间: 2021-01-17 11:19:50

monaco-io/request最新发布版本:v1.0.16(2023-07-02 21:37:42)


// Client Method
/*
     Method         = "OPTIONS"                ; Section 9.2
                    | "GET"                    ; Section 9.3
                    | "HEAD"                   ; Section 9.4
                    | "POST"                   ; Section 9.5
                    | "PUT"                    ; Section 9.6
                    | "DELETE"                 ; Section 9.7
                    | "TRACE"                  ; Section 9.8
                    | "CONNECT"                ; Section 9.9
                    | extension-method
   extension-method = token
     token          = 1*<any CHAR except CTLs or separators>
*/
type Client struct {
	// URL http request url like: https://www.google.com
	URL string

	// Method http method GET/POST/POST/DELETE ...
	Method string

	// Header http header
	Header map[string]string

	// Query params on http url
	Query map[string]string

	// JSON body as json string/bytes/struct
	JSON interface{}

	// XML body as xml string/bytes/struct
	XML interface{}

	// XML body as string
	String string

	// WWWForm TODO
	WWWForm interface{}

	// BasicAuth http basic auth with username and password
	BasicAuth BasicAuth

	// CustomerAuth add Authorization xxx to header
	CustomerAuth string

	// CustomerAuth add Authorization bearer xxx to header
	Bearer string

	// Timeout http request timeout
	Timeout time.Duration

	// TLSTimeout tls timeout
	TLSTimeout time.Duration

	// DialTimeout dial timeout
	DialTimeout time.Duration

	// ProxyURL proxy url
	ProxyURL string

	// Define the proxy function to be used during the transport
	ProxyServers map[string]string

	// Cookies original http cookies
	Cookies []*http.Cookie

	// CookiesMap add cookies as map
	CookiesMap map[string]string

	// TLSConfig tls config on transport
	TLSConfig *tls.Config

	// Transport http transport
	Transport *http.Transport
}

相关地址:原始地址 下载(tar) 下载(zip)

查看:2021-01-17发行的版本