Documentation
¶
Index ¶
- func Get(url string, args map[string]string) (result string, err error)
- func Post(url, contentType string, args map[string]string) (result string, err error)
- type Client
- func (h *Client) Do(req *http.Request) (response *http.Response, err error)
- func (h *Client) Get(url string, values url.Values) (body []byte, statusCode int, err error)
- func (h *Client) Post(url string, values url.Values) (body []byte, statusCode int, err error)
- func (h *Client) PostData(url string, values []byte) (body []byte, statusCode int, err error)
- func (h *Client) PostJSON(url string, jsonObject interface{}) (body []byte, statusCode int, err error)
- func (h *Client) SetHeader(header *Header)
- func (h *Client) SetTimeout(timeout time.Duration)
- func (h *Client) SetTransport(transport http.RoundTripper)
- type Header
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Header *Header // contains filtered or unexported fields }
Client Http客户端
func (*Client) PostJSON ¶
func (h *Client) PostJSON(url string, jsonObject interface{}) (body []byte, statusCode int, err error)
PostJSON send post request.
func (*Client) SetTransport ¶
func (h *Client) SetTransport(transport http.RoundTripper)
SetTransport 设置Transport
Click to show internal directories.
Click to hide internal directories.