httpclient

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 10 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 {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient() *HttpClient

func (*HttpClient) DELETE

func (client *HttpClient) DELETE(url string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) Delete

func (client *HttpClient) Delete(url string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) GET

func (client *HttpClient) GET(url string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) Get

func (client *HttpClient) Get(url string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) GetClient

func (client *HttpClient) GetClient() *http.Client

func (*HttpClient) NewTransPort

func (client *HttpClient) NewTransPort() *http.Transport

func (*HttpClient) PATCH

func (client *HttpClient) PATCH(url string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) POST

func (client *HttpClient) POST(url string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) PUT

func (client *HttpClient) PUT(url string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) Patch

func (client *HttpClient) Patch(url string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) Post

func (client *HttpClient) Post(url string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) Put

func (client *HttpClient) Put(url string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) Request

func (client *HttpClient) Request(url, method string, header http.Header, data []byte) ([]byte, error)

func (*HttpClient) RequestEx

func (client *HttpClient) RequestEx(url, method string, header http.Header, data []byte) (*HttpRespone, error)

func (*HttpClient) RequestStream

func (client *HttpClient) RequestStream(url, method string, header http.Header, data []byte) (io.ReadCloser, error)

func (*HttpClient) SetBatchHeader

func (client *HttpClient) SetBatchHeader(headerSet []*http2.HeaderSet)

SetBatchHeader batch set header for the http client。 Note:if the header is the same with the parameter(header) which is specified in the function GET, POST, PUT,DELETE,Patch and so on. this set header is ignore in the call

func (*HttpClient) SetHeader

func (client *HttpClient) SetHeader(key, value string)

SetHeader set header for the http client。 Note:if the header is the same with the parameter(header) which is specified in the function GET, POST, PUT,DELETE,Patch and so on. this set header is ignore in the call

func (*HttpClient) SetTimeOut

func (client *HttpClient) SetTimeOut(timeOut time.Duration)

func (*HttpClient) SetTlsNoVerity

func (client *HttpClient) SetTlsNoVerity() error

func (*HttpClient) SetTlsVerity

func (client *HttpClient) SetTlsVerity(caFile, certFile, keyFile, passwd string) error

func (*HttpClient) SetTlsVerityConfig

func (client *HttpClient) SetTlsVerityConfig(tlsConf *tls.Config)

func (*HttpClient) SetTlsVerityServer

func (client *HttpClient) SetTlsVerityServer(caFile string) error

func (*HttpClient) SetTransPort

func (client *HttpClient) SetTransPort(transport http.RoundTripper)

type HttpRespone

type HttpRespone struct {
	Reply      []byte
	StatusCode int
	Status     string
	Header     http.Header
}

HttpRespone define the information of the http respone

Jump to

Keyboard shortcuts

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