Documentation ¶
Index ¶
- Variables
- type Client
- func (c Client) Delete(path string) *Request
- func (c Client) Get(path string) *Request
- func (c Client) Head(path string) *Request
- func (c *Client) OnAfter(fn func(res *Response) error)
- func (c *Client) OnBefore(fn func(req *http.Request) error)
- 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
- 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)
- type ContentBody
- type FormData
- type Json
- type Request
- 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
- type Response
- type Urlencoded
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = New()
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string BaseHeader http.Header BaseParams url.Values // contains filtered or unexported fields }
func (*Client) SetTimeout ¶
func (*Client) SetTransport ¶
func (c *Client) SetTransport(transport http.RoundTripper)
type ContentBody ¶
type FormData ¶
type FormData struct {
// contains filtered or unexported fields
}
func (FormData) Form ¶
func (f FormData) Form() ContentBody
type Json ¶
type Json struct {
// contains filtered or unexported fields
}
func (Json) Form ¶
func (j Json) Form() ContentBody
type Request ¶
type Request struct { Method string Url string Header http.Header Params url.Values Body io.Reader Client *Client Dump bool }
func NewRequest ¶
type Urlencoded ¶
type Urlencoded struct {
// contains filtered or unexported fields
}
func (*Urlencoded) Add ¶
func (u *Urlencoded) Add(key string, value string)
func (*Urlencoded) Del ¶
func (u *Urlencoded) Del(key string)
func (Urlencoded) Form ¶
func (u Urlencoded) Form() ContentBody
func (*Urlencoded) Get ¶
func (u *Urlencoded) Get(key string) string
func (*Urlencoded) Set ¶
func (u *Urlencoded) Set(key string, value string)
Click to show internal directories.
Click to hide internal directories.