httpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	Cli http.Client
	// contains filtered or unexported fields
}

func NewHttpC

func NewHttpC(maxconns ...int) *HttpClient

只有一个参数

func NewHttpsC

func NewHttpsC(maxconns int, crtpath ...string) *HttpClient

func NewHttpsK

func NewHttpsK(maxconns int, svrCrt, cliCrt, cliKey string) *HttpClient

func (*HttpClient) GetCookie

func (h *HttpClient) GetCookie(packet string, method string, url string) (string, error)

func (*HttpClient) HttpGet

func (h *HttpClient) HttpGet(url string) ([]byte, error)

func (*HttpClient) HttpsPostForm

func (h *HttpClient) HttpsPostForm(url string, data url.Values) ([]byte, error)

func (*HttpClient) PostFile

func (h *HttpClient) PostFile(file string, url string) (body []byte, err error)

http 客户端POST文件数据 file 要发送的文件数据([]byte)或文件路径名(string) url 地址

func (*HttpClient) PostFileBytes

func (h *HttpClient) PostFileBytes(data []byte, url string) (rsp []byte, err error)

http 客户端POST文件数据 file 要发送的文件数据([]byte) url 地址

func (*HttpClient) SendUpstream

func (h *HttpClient) SendUpstream(packet string, method string, url string) ([]byte, error)

http 客户端发送数据 packet 要发送报文 method 选择发送方式 post get url 地址

func (*HttpClient) SetHeader

func (h *HttpClient) SetHeader(k, v string) *HttpClient

func (*HttpClient) SetStreamFlag

func (h *HttpClient) SetStreamFlag(v bool) *HttpClient

Jump to

Keyboard shortcuts

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