Documentation ¶
Index ¶
- Constants
- Variables
- func BuildUrl(domain string, ssl bool, path string, params map[string]string) string
- func GetBody(url string, headers Headers) ([]byte, error)
- func GetJSON(url string, headers Headers) (gjson.Result, error)
- func PostBody(url string, headers Headers, body io.Reader) ([]byte, error)
- func PostJSON(url string, headers Headers, body io.Reader) (gjson.Result, error)
- func PutBody(url string, headers Headers, body io.Reader) ([]byte, error)
- func PutJSON(url string, headers Headers, body io.Reader) (gjson.Result, error)
- type Client
- func (c *Client) Get(url string, headers Headers) (Response, error)
- func (c *Client) GetBody(url string, headers Headers) ([]byte, error)
- func (c *Client) GetJSON(url string, headers Headers) (gjson.Result, error)
- func (c *Client) Post(url string, headers Headers, body io.Reader) (Response, error)
- func (c *Client) PostBody(url string, headers Headers, body io.Reader) ([]byte, error)
- func (c *Client) PostJSON(url string, headers Headers, body io.Reader) (gjson.Result, error)
- func (c *Client) Put(url string, headers Headers, body io.Reader) (Response, error)
- func (c *Client) PutBody(url string, headers Headers, body io.Reader) ([]byte, error)
- func (c *Client) PutJSON(url string, headers Headers, body io.Reader) (gjson.Result, error)
- func (c *Client) Request(method, url string, headers Headers, body io.Reader) (Response, error)
- func (c *Client) RequestBody(method, url string, headers Headers, body io.Reader) ([]byte, error)
- func (c *Client) RequestJSON(method, url string, headers Headers, body io.Reader) (gjson.Result, error)
- type Headers
- type Response
Constants ¶
View Source
const DefaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) PUG/utils/net-latest Safari/537.36"
Variables ¶
View Source
var DefaultClient = NewClient()
Functions ¶
Types ¶
type Client ¶
type Client struct { UserAgent string // contains filtered or unexported fields }
func (*Client) RequestBody ¶
Click to show internal directories.
Click to hide internal directories.