Documentation
¶
Overview ¶
Copyright 2021 Murray Inc. All Rights Reserved.
2021/10/18 11:17, by m18527, create ----------------------------------- Http请求方法封装
Copyright 2021 Murray Inc. All Rights Reserved.
2021/12/02 16:27, by m18527, create -----------------------------------
Index ¶
- Variables
- func HttpBaseCommon(method, username, password, url, payload string, header map[string]string) ([]byte, int, error)
- func HttpBasicDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpBasicGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpBasicPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpBasicPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpCommon(method, url, payload string, header map[string]string) ([]byte, int, error)
- func HttpDelete(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpDigestCommon(method, username, password, url, payload string, header map[string]string) ([]byte, int, error)
- func HttpDigestDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpDigestGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpDigestPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpDigestPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpGet(url string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpPost(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func HttpPut(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
- func InitHttp()
- func NewHttpClient() *http.Client
- func NewRequest(method, url string, body io.Reader) (*http.Request, error)
- func UserAgent() string
- func UserAgentChrome() string
- func UserAgentFirefox() string
- func UserAgentIE() string
- func UserAgentOpera() string
- func UserAgentSafari() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 全局变量 GlobalCookieJar *cookiejar.Jar Header http.Header )
Functions ¶
func HttpBaseCommon ¶ added in v1.0.8
func HttpBaseCommon(method, username, password, url, payload string, header map[string]string) ([]byte, int, error)
Common
func HttpBasicDelete ¶
func HttpBasicDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Delete
func HttpBasicGet ¶
func HttpBasicGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)
Get
func HttpBasicPost ¶
func HttpBasicPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Post
func HttpBasicPut ¶
func HttpBasicPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Put
func HttpCommon ¶
func HttpDelete ¶
Delete
func HttpDigestCommon ¶ added in v1.0.8
func HttpDigestDelete ¶
func HttpDigestDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Delete
func HttpDigestGet ¶
func HttpDigestGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)
Get
func HttpDigestPost ¶
func HttpDigestPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Post
func HttpDigestPut ¶
func HttpDigestPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)
Put
func NewRequest ¶
http客户端
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.