Documentation ¶
Index ¶
- func DecodeJSONResponse(resp *http.Response) (map[string]interface{}, error)
- func ParseError(err error) int
- type Client
- func (c *Client) AppendUA(ua string) *Client
- func (c *Client) Clone() *Client
- func (c *Client) DefaultUAWithComment(ua string) *Client
- func (c *Client) Delete() (*http.Response, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) Get() (*http.Response, error)
- func (c *Client) Head() (*http.Response, error)
- func (c *Client) Patch(body io.Reader) (*http.Response, error)
- func (c *Client) Post(body io.Reader) (*http.Response, error)
- func (c *Client) PostForm(data url.Values) (*http.Response, error)
- func (c *Client) Put(body io.Reader) (*http.Response, error)
- func (c *Client) UseSocks5Proxy(ps string) error
- func (c *Client) WithAccept(a string) *Client
- func (c *Client) WithContentT(ct string) *Client
- func (c *Client) WithUA(ua string) *Client
- func (c *Client) WithURL(url string) *Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONResponse ¶
DecodeJSONResponse decode the response data to a JSON object
Types ¶
type Client ¶
type Client struct { URL string // contains filtered or unexported fields }
Client is a wrap of http.Client to fit our usage
func (*Client) DefaultUAWithComment ¶
DefaultUAWithComment sets the comment block of default UA and use it
func (*Client) PostForm ¶
PostForm is a wrap of http.Client.PostForm(), that send the POST request with form to server
func (*Client) UseSocks5Proxy ¶
UseSocks5Proxy set the client to use a Socks5 Proxy for requests
func (*Client) WithAccept ¶
WithAccept set the accept header to given string
func (*Client) WithContentT ¶
WithContentT set the content type header to given string
Click to show internal directories.
Click to hide internal directories.