Documentation
¶
Index ¶
- type CompressionType
- type Options
- func (opt *Options) AddCookie(cookie *http.Cookie)
- func (opt *Options) AddHeader(key string, value string)
- func (opt *Options) ClearCookies()
- func (opt *Options) ClearHeaders()
- func (opt *Options) Compress(compressionType CompressionType)
- func (opt *Options) DisableRedirects() bool
- func (opt *Options) EnableRedirects() bool
- func (opt *Options) ListCookies()
- func (opt *Options) ListHeaders()
- func (opt *Options) SetProtocolScheme(scheme string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompressionType ¶
type CompressionType string
const ( CompressionNone CompressionType = "" CompressionGzip CompressionType = "gzip" CompressionDeflate CompressionType = "deflate" CompressionBrotli CompressionType = "br" )
type Options ¶
type Options struct {
Headers []kv.Header // Custom headers to be added to the request.
Cookies []*http.Cookie // Cookies to be included in the request.
ProtocolScheme string // define a custom protocol scheme. It defaults to https
Compression CompressionType // CompressionType to use: none, gzip, deflate or brotli
UserAgent string // User Agent to send with requests
DisableRedirect bool // Disable or enable redirects. Default is false - do not disable redirects
}
RequestOptions represents additional options for the HTTP request.
DisableRedirect - Determines if redirects should be followed or not. The default option is false which means redirects will be followed.
func NewOptions ¶
func NewOptions() Options
func (*Options) ClearCookies ¶
func (opt *Options) ClearCookies()
ClearCookies clears all cookies in the RequestOptions.
func (*Options) ClearHeaders ¶
func (opt *Options) ClearHeaders()
ClearHeaders clears all headers in the RequestOptions.
func (*Options) Compress ¶
func (opt *Options) Compress(compressionType CompressionType)
func (*Options) DisableRedirects ¶
func (*Options) EnableRedirects ¶
func (*Options) ListCookies ¶
func (opt *Options) ListCookies()
ListCookies prints out the list of cookies in the RequestOptions.
func (*Options) ListHeaders ¶
func (opt *Options) ListHeaders()
ListHeaders prints out the list of headers in the RequestOptions.
func (*Options) SetProtocolScheme ¶
Click to show internal directories.
Click to hide internal directories.