Versions in this module Expand all Collapse all v0 v0.0.2 Mar 8, 2023 v0.0.1 Mar 8, 2023 Changes in this version + var ErrRedirectLimitExceeded = errors.New("grequests: Request exceeded redirect count") + var RedirectLimitNum = 30 + var SensitiveHeaders = map[string]struct + func BuildHTTPClient(ro RequestOptions) *http.Client + func EnsureTransporterFinalized(httpTransport *http.Transport) + type FileUpload struct + FieldName string + FileContents io.ReadCloser + FileMime string + FileName string + func FileUploadFromDisk(fileName string) ([]FileUpload, error) + func FileUploadFromGlob(fileSystemGlob string) ([]FileUpload, error) + type RequestOption func(o *RequestOptions) + func Auth(a []string) RequestOption + func BeforeRequest(fn func(req *http.Request) error) RequestOption + func Context(ctx context.Context) RequestOption + func CookieJar(cj http.CookieJar) RequestOption + func Cookies(c []*http.Cookie) RequestOption + func Data(d map[string]string) RequestOption + func DialKeepAlive(d time.Duration) RequestOption + func DialTimeout(d time.Duration) RequestOption + func DisableCompression(b bool) RequestOption + func Files(files []FileUpload) RequestOption + func HTTPClient(c *http.Client) RequestOption + func Headers(h map[string]string) RequestOption + func Host(host string) RequestOption + func InsecureSkipVerify(b bool) RequestOption + func IsAjax(b bool) RequestOption + func JSON(JSON interface{}) RequestOption + func LocalAddr(la *net.TCPAddr) RequestOption + func Params(p map[string]string) RequestOption + func Proxies(p map[string]*url.URL) RequestOption + func QueryStruct(q interface{}) RequestOption + func RedirectLimit(rl int) RequestOption + func RequestBody(b io.Reader) RequestOption + func RequestTimeout(d time.Duration) RequestOption + func SensitiveHTTPHeaders(h map[string]struct{}) RequestOption + func TLSHandshakeTimeout(d time.Duration) RequestOption + func UseCookieJar(b bool) RequestOption + func UserAgent(ua string) RequestOption + func XML(XML interface{}) RequestOption + type RequestOptions struct + Auth []string + BeforeRequest func(req *http.Request) error + Context context.Context + CookieJar http.CookieJar + Cookies []*http.Cookie + Data map[string]string + DialKeepAlive time.Duration + DialTimeout time.Duration + DisableCompression bool + Files []FileUpload + HTTPClient *http.Client + Headers map[string]string + Host string + InsecureSkipVerify bool + IsAjax bool + JSON interface{} + LocalAddr *net.TCPAddr + Params map[string]string + Proxies map[string]*url.URL + QueryStruct interface{} + RedirectLimit int + RequestBody io.Reader + RequestTimeout time.Duration + SensitiveHTTPHeaders map[string]struct{} + TLSHandshakeTimeout time.Duration + UseCookieJar bool + UserAgent string + XML interface{} + type Response struct + Error error + Header http.Header + Ok bool + RawResponse *http.Response + StatusCode int + func Delete(url string, opts ...RequestOption) (*Response, error) + func DoRegularRequest(requestVerb, url string, opts ...RequestOption) (*Response, error) + func Get(url string, opts ...RequestOption) (*Response, error) + func Head(url string, opts ...RequestOption) (*Response, error) + func Options(url string, opts ...RequestOption) (*Response, error) + func Patch(url string, opts ...RequestOption) (*Response, error) + func Post(url string, opts ...RequestOption) (*Response, error) + func Put(url string, opts ...RequestOption) (*Response, error) + func Req(verb string, url string, opts ...RequestOption) (*Response, error) + func (r *Response) Bytes() []byte + func (r *Response) ClearInternalBuffer() + func (r *Response) Close() error + func (r *Response) DownloadToFile(fileName string) error + func (r *Response) JSON(userStruct interface{}) error + func (r *Response) Read(p []byte) (n int, err error) + func (r *Response) String() string + func (r *Response) XML(userStruct interface{}, charsetReader XMLCharDecoder) error + type Session struct + HTTPClient *http.Client + RequestOptions *RequestOptions + func NewSession(opts ...RequestOption) *Session + func (s *Session) CloseIdleConnections() + func (s *Session) Delete(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Get(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Head(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Options(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Patch(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Post(url string, opts ...RequestOption) (*Response, error) + func (s *Session) Put(url string, opts ...RequestOption) (*Response, error) + type XMLCharDecoder func(charset string, input io.Reader) (io.Reader, error)