Versions in this module Expand all Collapse all v0 v0.2.0 Apr 30, 2026 v0.1.2 Apr 30, 2026 Changes in this version + var ErrCanceled = errors.New("goreqs: canceled") type Client + MaxResponseSize int64 v0.1.1 Apr 30, 2026 Changes in this version + const UserAgent + const Version + var DefaultClient = &Client + var ErrConnect = errors.New("goreqs: connection error") + var ErrInvalidHeader = errors.New("goreqs: invalid header") + var ErrInvalidProxy = errors.New("goreqs: invalid proxy url") + var ErrInvalidScheme = errors.New("goreqs: invalid scheme") + var ErrInvalidURL = errors.New("goreqs: invalid url") + var ErrMissingScheme = errors.New("goreqs: missing scheme") + var ErrTLS = errors.New("goreqs: tls error") + var ErrTimeout = errors.New("goreqs: timeout") + var ErrTooManyRedirects = errors.New("goreqs: too many redirects") + var ErrUnrewindable = errors.New("goreqs: unrewindable body") + func CookiesAsMap(cs []*http.Cookie) map[string]string + func CookiesFromMap(m map[string]string) []*http.Cookie + type Auth interface + Apply func(req *http.Request) error + func BasicAuth(user, pass string) Auth + func DigestAuth(user, pass string) Auth + func ProxyAuth(user, pass string) Auth + type ChallengeAuth interface + Challenge func(req *http.Request, resp *http.Response) error + type Client struct + Auth Auth + Cert any + Header http.Header + Jar http.CookieJar + MaxRedirects int + Proxies map[string]string + Timeout time.Duration + Transport http.RoundTripper + TrustEnv bool + Verify any + func New() *Client + func (c *Client) Close() error + func (c *Client) Delete(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Do(ctx context.Context, req *http.Request) (*Response, error) + func (c *Client) Get(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Head(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Options(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Patch(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Post(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Put(ctx context.Context, url string, opts ...Opts) (*Response, error) + func (c *Client) Request(ctx context.Context, method, url string, opts ...Opts) (*Response, error) + type CookieJar = http.CookieJar + func NewJar() (CookieJar, error) + type File struct + ContentType string + File io.Reader + Filename string + Header textproto.MIMEHeader + Name string + type HTTPError struct + Resp *Response + func (e *HTTPError) Error() string + type Link struct + Params map[string]string + Rel string + URL string + type Opts struct + AllowRedirects *bool + Auth Auth + Body io.Reader + Cert any + Cookies []*http.Cookie + Files []File + Form url.Values + Header http.Header + JSON any + Params url.Values + Proxies map[string]string + Stream bool + Timeout time.Duration + Verify any + type RequestError struct + Err error + Req *http.Request + Resp *Response + func (e *RequestError) Error() string + func (e *RequestError) Unwrap() error + type Response struct + Elapsed time.Duration + History []*Response + func Delete(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Get(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Head(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Options(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Patch(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Post(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Put(ctx context.Context, url string, opts ...Opts) (*Response, error) + func Request(ctx context.Context, method, url string, opts ...Opts) (*Response, error) + func (r *Response) ApparentEncoding() string + func (r *Response) Bytes() ([]byte, error) + func (r *Response) Encoding() string + func (r *Response) JSON(v any) error + func (r *Response) Links() map[string]Link + func (r *Response) OK() bool + func (r *Response) RaiseForStatus() error + func (r *Response) SetEncoding(name string) + func (r *Response) Text() (string, error) + type URLError struct + Err error + URL string + func (e *URLError) Error() string + func (e *URLError) Unwrap() error v0.1.0 Apr 30, 2026