Versions in this module Expand all Collapse all v0 v0.1.0 Mar 7, 2018 Changes in this version + const DefaultFormContentType + const DefaultJsonContentType + const DefaultPayloadContentType + var DefaultDailTimeout = 30 * time.Second + var DefaultHeaders = map[string]string + var DefaultInsecureSkipVerify = false + var DefaultRedirectLimit = 10 + var DefaultRequestTimeout = 30 * time.Second + var DefaultTLSHandshakeTimeout = 30 * time.Second + var DefaultUserAgent = "subchen/go-curl" + var ErrMaxRedirect = errors.New("Exceeded max redirects") + type BasicAuth struct + Password string + Username string + func (a *BasicAuth) RequestHeaderValue() string + type Request struct + Auth interface{} + Body interface{} + Client *http.Client + Cookies map[string]string + Files []UploadFile + Form interface{} + Headers map[string]string + JSON interface{} + Method string + ProxyURL string + QueryString interface{} + RedirectDisabled bool + Transport *http.Transport + URL string + func NewRequest() *Request + func (r *Request) AddCookie(name, value string) *Request + func (r *Request) AddFile(field, filename string) *Request + func (r *Request) AddHeader(name, value string) *Request + func (r *Request) Delete(url string) (*Response, error) + func (r *Request) Do() (*Response, error) + func (r *Request) Get(url string) (*Response, error) + func (r *Request) Head(url string) (*Response, error) + func (r *Request) Options(url string) (*Response, error) + func (r *Request) Patch(url string) (*Response, error) + func (r *Request) Post(url string) (*Response, error) + func (r *Request) Put(url string) (*Response, error) + func (r *Request) Reset() *Request + func (r *Request) SetBasicAuth(name, passwd string) *Request + func (r *Request) SetBody(body interface{}) *Request + func (r *Request) SetForm(form interface{}) *Request + func (r *Request) SetJSON(json interface{}) *Request + func (r *Request) SetProxyURL(url string) *Request + func (r *Request) SetQueryString(qs interface{}) *Request + func (r *Request) SetTokenAuth(token string) *Request + type Response struct + func (resp *Response) Content() ([]byte, error) + func (resp *Response) JSON() (map[string]interface{}, error) + func (resp *Response) JSONUnmarshal(data interface{}) error + func (resp *Response) OK() bool + func (resp *Response) RequestURL() (*url.URL, error) + func (resp *Response) Text() (string, error) + type TokenAuth struct + Token string + func (a *TokenAuth) RequestHeaderValue() string + type UploadFile struct + Fieldname string + Filename string