Documentation ¶
Index ¶
- Variables
- func LoadCerts(certFile, keyFile string) ([]tls.Certificate, error)
- func NewTransport(targetHostPem []byte, myCerts []tls.Certificate, skipVerify bool) *http.Transport
- type Client
- func (s *Client) AppendCookie(cookie *http.Cookie) *Client
- func (s *Client) Client() *http.Client
- func (s *Client) Close() error
- func (s *Client) Cookies() []*http.Cookie
- func (s *Client) Get(uri string, query, header map[string]string) (*Response, error)
- func (s *Client) Headers() map[string]string
- func (s *Client) Options() Options
- func (s *Client) PostForm(uri string, query, form map[string]string, files []UploadFile) (*Response, error)
- func (s *Client) PostJSON(uri string, query map[string]string, data interface{}) (*Response, error)
- func (s *Client) Request(method, url string, urlQuery map[string]string, body io.Reader) (*Response, error)
- func (s *Client) SetCookies(cookies []*http.Cookie) *Client
- func (s *Client) SetHeader(name, value string) *Client
- func (s *Client) SetHeaders(headers map[string]string) *Client
- func (s *Client) SetTransport(transport http.RoundTripper) *Client
- func (s *Client) Transport() http.RoundTripper
- type Closeable
- type Options
- type Response
- type UploadFile
Constants ¶
This section is empty.
Variables ¶
View Source
var ContentTypeKey = "Content-Type"
Functions ¶
func LoadCerts ¶
func LoadCerts(certFile, keyFile string) ([]tls.Certificate, error)
Load certificate files with PEM format
func NewTransport ¶
NewTransport new http2 transport. For http client, please skip targetHostPem,myCert.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SetTransport ¶
func (s *Client) SetTransport(transport http.RoundTripper) *Client
func (*Client) Transport ¶
func (s *Client) Transport() http.RoundTripper
Click to show internal directories.
Click to hide internal directories.