Documentation
¶
Index ¶
- Variables
- func GetRequest(url string) ([]byte, error)
- func HeaderHttpPostRequest(urlstr string, msgbody string, headers *map[string]string) ([]byte, error)
- func HttpGetRequest(urlstr string, reqBody string) ([]byte, error)
- func HttpPostRequest(urlstr string, msgbody string) ([]byte, error)
- func HttpRequest(method string, url, requestBody string) ([]byte, error)
- func HttpRequestByHeader(method string, url, requestBody string, header map[string]string) ([]byte, error)
- func TokenHttpRequest(method string, value url.Values, url, token string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var HttpConnectPool http.RoundTripper = &http.Transport{ DialContext: (&net.Dialer{ Timeout: 10 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, MaxIdleConns: 1000, IdleConnTimeout: 60 * time.Second, ExpectContinueTimeout: 1 * time.Second, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, }
http args
Functions ¶
func GetRequest ¶
* * @Description: * @param: url * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:16:28 *
func HeaderHttpPostRequest ¶
func HeaderHttpPostRequest(urlstr string, msgbody string, headers *map[string]string) ([]byte, error)
* * @Description: 自定义head的post请求 * @param: urlstr * @param: msgbody * @param: headers * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:17:05 *
func HttpGetRequest ¶
* * @Description: 不带授权get请求 * @param: urlstr * @param: reqBody * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:16:41 *
func HttpPostRequest ¶
* * @Description: 不带授权post请求 * @param: urlstr * @param: msgbody * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:17:05 *
func HttpRequest ¶
* * @Description: http请求 ,支持传入方式 * @param: method * @param: url * @param: requestBody * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:16:03 *
func HttpRequestByHeader ¶ added in v1.0.4
func HttpRequestByHeader(method string, url, requestBody string, header map[string]string) ([]byte, error)
* * @Description: http请求 ,支持传入方式, 带header * @param: method * @param: url * @param: requestBody * @return: []byte * @return: error * @Author: ken * @Date: 2025-03-12 17:16:03 *
Types ¶
This section is empty.