Versions in this module Expand all Collapse all v0 v0.0.1 May 13, 2019 Changes in this version + var ErrEmptyProxy = errors.New("proxy is empty") + func DumpRequest(req *http.Request) ([]byte, error) + func DumpRequestIndent(req *http.Request) string + func SetLogFunc(f func(string, ...interface{})) + func Wget(url, name string) (int, error) + type Request struct + Body []byte + Cookies map[string]string + Form url.Values + Headers map[string]string + Method string + Params map[string]interface{} + Retry int + URL string + func NewRequest(method, urlstr string, body io.Reader) *Request + func (req *Request) MergeIn(r *Request) + func (req *Request) Request() (*http.Request, error) + func (req *Request) SetAuth(user, pass string) *Request + func (req *Request) SetBody(body interface{}) error + func (req *Request) SetCookie(k, v string) *Request + func (req *Request) SetCookies(kv map[string]string) *Request + func (req *Request) SetForm(k, v string) *Request + func (req *Request) SetHeader(k, v string) *Request + func (req *Request) SetHeaders(kv map[string]string) *Request + func (req *Request) SetMethod(method string) *Request + func (req *Request) SetParam(k string, v interface{}) *Request + func (req *Request) SetParams(query map[string]interface{}) *Request + func (req *Request) SetRetry(retry int) *Request + func (req *Request) SetURL(url string) *Request + type Response struct + func Delete(url string, body interface{}) (resp *Response, err error) + func Get(url string) (*Response, error) + func Head(url string) (resp *Response, err error) + func PUT(url string, body interface{}) (resp *Response, err error) + func Post(url, contentType string, body interface{}) (*Response, error) + func PostForm(url string, data url.Values) (resp *Response, err error) + func WarpResponse(resp *http.Response) *Response + func (resp *Response) Copy() *Response + func (resp *Response) Download(name string) (int, error) + func (resp *Response) Dump() ([]byte, error) + func (resp *Response) DumpIndent() string + func (resp *Response) JSON(v interface{}) error + func (resp *Response) StdLib() *http.Response + func (resp *Response) Text() (string, error) + type Session struct + LogFunc func(string, ...interface{}) + func New() *Session + func (sess *Session) DebugTrace(request *Request) + func (sess *Session) Delete(url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) DeleteWithContext(ctx context.Context, url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) Do(method, url, contentType string, body io.Reader) (*Response, error) + func (sess *Session) DoRequest(request *Request, ctx ...context.Context) (*Response, error) + func (sess *Session) DoWithContext(ctx context.Context, method, url, contentType string, body io.Reader) (*Response, error) + func (sess *Session) Get(url string) (*Response, error) + func (sess *Session) GetWithContext(ctx context.Context, url string) (*Response, error) + func (sess *Session) Post(url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) PostForm(url string, data url.Values) (resp *Response, err error) + func (sess *Session) PostFormWithContext(ctx context.Context, url string, data url.Values) (resp *Response, err error) + func (sess *Session) PostWithContext(ctx context.Context, url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) Put(url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) PutWithContext(ctx context.Context, url, contentType string, body io.Reader) (resp *Response, err error) + func (sess *Session) SetAuth(user, pass string) *Session + func (sess *Session) SetCookie(k, v string) *Session + func (sess *Session) SetHeader(k, v string) *Session + func (sess *Session) SetHeaders(kv map[string]string) *Session + func (sess *Session) SetKeepAlives(keepAlives bool) *Session + func (sess *Session) SetLogFunc(f func(string, ...interface{})) *Session + func (sess *Session) SetParam(k string, v interface{}) *Session + func (sess *Session) SetParams(kv map[string]interface{}) *Session + func (sess *Session) SetProxy(addr string) error + func (sess *Session) SetRetry(retry int, retryFunc ...func(Response, error) error) *Session + func (sess *Session) SetTimeout(timeout int) *Session