Documentation ¶
Index ¶
- func DefaultRedirectCb(req *http.Request, via []*http.Request) error
- func DisableRedirectCb(req *http.Request, via []*http.Request) error
- func IsHtml(data []byte) bool
- func IsJson(data []byte) bool
- func JsonConvert(data []byte, v interface{}) error
- func JsonErr(err error, data []byte)
- func JsonToMap(data []byte) map[string]interface{}
- func JsonToStruct(data []byte, v interface{})
- func PanicIf(err error)
- func ReactIf(err error, f func())
- type Clienter
- type HttpClient
- func (c *HttpClient) Do(req *HttpReq) *HttpResp
- func (c *HttpClient) Get(url string) *HttpResp
- func (c *HttpClient) LoadCookies(filepath string) error
- func (c *HttpClient) Post(url string, body io.Reader) *HttpResp
- func (c *HttpClient) PostForm(url, body string) *HttpResp
- func (c *HttpClient) PostJson(url, body string) *HttpResp
- func (c *HttpClient) StoreCookies(filepath string) error
- type HttpReq
- type HttpResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonConvert ¶
func JsonToStruct ¶
func JsonToStruct(data []byte, v interface{})
Types ¶
type HttpClient ¶
var DefaultClient *HttpClient
func NewClient ¶
func NewClient() *HttpClient
func (*HttpClient) Do ¶
func (c *HttpClient) Do(req *HttpReq) *HttpResp
func (*HttpClient) Get ¶
func (c *HttpClient) Get(url string) *HttpResp
func (*HttpClient) LoadCookies ¶
func (c *HttpClient) LoadCookies(filepath string) error
func (*HttpClient) PostForm ¶
func (c *HttpClient) PostForm(url, body string) *HttpResp
func (*HttpClient) PostJson ¶
func (c *HttpClient) PostJson(url, body string) *HttpResp
func (*HttpClient) StoreCookies ¶
func (c *HttpClient) StoreCookies(filepath string) error
Click to show internal directories.
Click to hide internal directories.