Versions in this module Expand all Collapse all v0 v0.1.0 Jan 5, 2024 Changes in this version + var DefaultClient = New() + type Client struct + BaseHeader http.Header + BaseParams url.Values + BaseURL string + func New() *Client + func (c *Client) OnAfter(fn func(res *Response) error) + func (c *Client) OnBefore(fn func(req *http.Request) error) + func (c *Client) Req(method string, path string) *Request + func (c *Client) SetDump(enable bool) + func (c *Client) SetJar(jar http.CookieJar) + func (c *Client) SetTimeout(timeout time.Duration) + func (c *Client) SetTransport(transport http.RoundTripper) + func (c Client) Delete(path string) *Request + func (c Client) Get(path string) *Request + func (c Client) Head(path string) *Request + func (c Client) Patch(path string, body io.Reader) *Request + func (c Client) Post(path string, body io.Reader) *Request + func (c Client) Put(path string, body io.Reader) *Request + type ContentBody struct + Type string + func (c ContentBody) Read(p []byte) (n int, err error) + type FormData struct + func (f *FormData) Add(key string, value string) error + func (f *FormData) AddFile(key string, filename string, file *os.File) error + func (f FormData) Form() ContentBody + type Json struct + func (j *Json) Set(v interface{}) error + func (j Json) Form() ContentBody + type Request struct + Body io.Reader + Client *Client + Dump bool + Header http.Header + Method string + Params url.Values + Url string + func Delete(path string) *Request + func Get(path string) *Request + func Head(path string) *Request + func NewRequest(method string, path string) *Request + func Patch(path string, body io.Reader) *Request + func Post(path string, body io.Reader) *Request + func Put(path string, body io.Reader) *Request + func Req(method string, path string) *Request + func (r *Request) Do() (res *Response, err error) + type Response struct + func (r *Response) Raw() ([]byte, error) + func (r Response) Json(v interface{}) error + func (r Response) String() (string, error) + type Urlencoded struct + func (u *Urlencoded) Add(key string, value string) + func (u *Urlencoded) Del(key string) + func (u *Urlencoded) Get(key string) string + func (u *Urlencoded) Set(key string, value string) + func (u Urlencoded) Form() ContentBody