httpclient

package
v3.0.8-alpha.10+incomp... Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxyHttp

func ProxyHttp(c *gin.Context, addr string)

porxy http

func ProxyRestHttp

func ProxyRestHttp(req *restful.Request, resp *restful.Response, addr string)

rest-api请求转发

func ReqForward

func ReqForward(req *restful.Request, url, method string) (string, error)

rest-api http请求代理

func ReqHttp

func ReqHttp(req *restful.Request, url, method string, body []byte) (string, error)

rest-api请求转发

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) DELETEEx

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

func (*HttpClient) DoWithTimeout

func (client *HttpClient) DoWithTimeout(timeout time.Duration, req *http.Request) (*http.Response, error)

func (*HttpClient) GET

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

func (*HttpClient) GETEx

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

func (*HttpClient) GetClient

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

func (*HttpClient) NewTransPort

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

func (*HttpClient) POST

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

func (*HttpClient) POSTEx

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

func (*HttpClient) PUT

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

func (*HttpClient) PUTEx

func (client *HttpClient) PUTEx(url string, header http.Header, data []byte) (int, []byte, 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) (int, []byte, error)

func (*HttpClient) SetHeader

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

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

Jump to

Keyboard shortcuts

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