Documentation ¶
Index ¶
- func ReadResponse(resp *orig.Response, err error) (code int, body []byte)
- type Client
- func (c *Client) AddHeader(key, value string)
- func (c *Client) Delete(url, query string) (int, string)
- func (c *Client) Do(method, url string, reader io.Reader) (int, []byte)
- func (c *Client) DoWrap(url string, req *Resource, dec DecodeFunc) (int, error)
- func (c *Client) Get(url, query string) (code int, body string)
- func (c *Client) Head(url, query string) (int, string)
- func (c *Client) Post(url string, data []byte) (int, []byte)
- func (c *Client) PostForm(url, data string) (int, string)
- func (c *Client) PostJson(url string, obj, res interface{}) (int, error)
- func (c *Client) Put(url string, data []byte) (int, []byte)
- func (c *Client) SetContentType(ctype string)
- func (c *Client) SetPemCert(pemfile string) error
- type DecodeFunc
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
http或https客户端
func (*Client) SetContentType ¶
type DecodeFunc ¶
func NewJsonDecoder ¶
func NewJsonDecoder(res interface{}) DecodeFunc
type Resource ¶
func NewJsonReq ¶
Click to show internal directories.
Click to hide internal directories.