http_client

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func GetRequest(url string) ([]byte, error)

* * @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

func HttpGetRequest(urlstr string, reqBody string) ([]byte, error)

* * @Description: 不带授权get请求 * @param: urlstr * @param: reqBody * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:16:41 *

func HttpPostRequest

func HttpPostRequest(urlstr string, msgbody string) ([]byte, error)

* * @Description: 不带授权post请求 * @param: urlstr * @param: msgbody * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:17:05 *

func HttpRequest

func HttpRequest(method string, url, requestBody string) ([]byte, error)

* * @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 *

func TokenHttpRequest

func TokenHttpRequest(method string, value url.Values, url, token string) ([]byte, error)

* * @Description: 带token的http请求 * @param: method * @param: value * @param: url * @param: token * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-15 17:16:33 *

Types

This section is empty.

Jump to

Keyboard shortcuts

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