Versions in this module Expand all Collapse all v0 v0.0.4 Apr 15, 2023 v0.0.3 Apr 6, 2023 v0.0.2 Jan 18, 2023 v0.0.1 Jan 16, 2023 Changes in this version + var ErrRedirectLimitExceeded = errors.New("requests: Request exceeded redirect count") + var RedirectLimit = 30 + var SensitiveHTTPHeaders = 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 + type RequestOptions struct + Auth []string + BeforeRequest func(req *http.Request) error + Context context.Context + CookieJar http.CookieJar + Cookies map[string]string + Data map[string]string + DialKeepAlive time.Duration + DialTimeout time.Duration + DisableCompression bool + FileUploads []FileUpload + Files map[string]string + 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, ro *RequestOptions) (*Response, error) + func Get(url string, ro *RequestOptions) (*Response, error) + func Head(url string, ro *RequestOptions) (*Response, error) + func Options(url string, ro *RequestOptions) (*Response, error) + func Patch(url string, ro *RequestOptions) (*Response, error) + func Post(url string, ro *RequestOptions) (*Response, error) + func Put(url string, ro *RequestOptions) (*Response, error) + func SendRequest(method, url string, ro *RequestOptions) (*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(ro *RequestOptions) *Session + func (s *Session) CloseIdleConnections() + func (s *Session) Delete(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Get(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Head(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Options(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Patch(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Post(url string, ro *RequestOptions) (*Response, error) + func (s *Session) Put(url string, ro *RequestOptions) (*Response, error) + type XMLCharDecoder func(charset string, input io.Reader) (io.Reader, error)