httputils

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHeadersMap

func CreateHeadersMap(headers []string) map[string]string

func CreateHttpClient

func CreateHttpClient(transportNetwork, localAddr string, secureSkipVerify bool, proxyType, proxyUrl, user, passwd string, timeout time.Duration) (*http.Client, error)

func GetAndParseJSONResponseFromGoutDoHttpRequest

func GetAndParseJSONResponseFromGoutDoHttpRequest(transportNetwork, localAddr, method, url, requestBody, proxyType, proxyUrl, user, passwd string,
	headers map[string]string, secureSkipVerify bool, timeout time.Duration, result interface{}) error

func GetAndParseJSONResponseFromHttpResponse

func GetAndParseJSONResponseFromHttpResponse(resp *http.Response, result interface{}) error

func GetBytesFromGoutDoHttpRequest

func GetBytesFromGoutDoHttpRequest(transportNetwork, localAddr, method, url, requestBody, proxyType, proxyUrl, user, passwd string,
	headers map[string]string, secureSkipVerify bool, timeout time.Duration) (int, []byte, error)

func GetBytesFromHttpResponse

func GetBytesFromHttpResponse(resp *http.Response) ([]byte, error)

GetStringFromHttpResponse 从response获取

func GetStringFromHttpResponse

func GetStringFromHttpResponse(resp *http.Response) (string, error)

GetStringFromHttpResponse 从response获取

func GetStringGoutDoHttpRequest

func GetStringGoutDoHttpRequest(transportNetwork, localAddr, method, url, requestBody, proxyType, proxyUrl, user, passwd string,
	headers map[string]string, secureSkipVerify bool, timeout time.Duration) (int, string, error)

func NewGout

func NewGout(transportNetwork, localAddr string, secureSkipVerify bool, proxyType, proxyUrl, user, passwd string, timeout time.Duration) (*dataflow.Gout, error)

func NewTransport

func NewTransport(transportNetwork,
	localAddrStr string,
	secureSkipVerify bool,
	proxyType,
	proxyUrl,
	user,
	passwd string) (*http.Transport, error)

NewTransport transportNetwork 网络类型 tcp tcp4 tcp6 localAddr 指定网卡出口

func SplitHostPort added in v1.3.1

func SplitHostPort(hostPort string) (host, port string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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