Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Delete(url string, data []byte) (*Response, error)
- func (c *Client) Get(url string) (*Response, error)
- func (c *Client) Post(url string, data []byte) (*Response, error)
- func (c *Client) Put(url string, data []byte) (*Response, error)
- func (c *Client) Request(method, url string, payload []byte) (*Response, error)
- func (c *Client) SetHeader(key, value string) *Client
- func (c *Client) SetHeaders(headers map[string]string) *Client
- func (c *Client) SetPemCertificate(pemFile string) *Client
- func (c *Client) SetQuery(query map[string]string) *Client
- func (c *Client) SetTimeout(timeout time.Duration) *Client
- type Response
- func (r *Response) GetAsString() (string, error)
- func (r *Response) GetHeader(key string) string
- func (r *Response) GetRaw() io.Reader
- func (r *Response) GetStatusCode() int
- func (r *Response) GetUnmarshalJSON(v interface{}) error
- func (r *Response) GetUnmarshalXML(v interface{}) error
- func (r *Response) IsTimeout() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMaxIdleConns = 100 DefaultMaxIdleConnsPerHost = 100 DefaultRequestTimeout = 10000 * time.Millisecond )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Transport *http.Transport Cookie http.CookieJar // contains filtered or unexported fields }
Client http request very simple
func (*Client) SetHeaders ¶
SetHeaders handle http client request headers
func (*Client) SetPemCertificate ¶
SetPemCertificate http client request use ssl
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func (*Response) GetAsString ¶
GetAsString http response client
func (*Response) GetStatusCode ¶
GetStatusCode http client response
func (*Response) GetUnmarshalJSON ¶
GetFromJSON response http client
func (*Response) GetUnmarshalXML ¶
GetFromXML response http client
Click to show internal directories.
Click to hide internal directories.