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) FileWriter(filename string) error
- func (opt *Options) GenerateIdentifier() string
- func (opt *Options) ListCookies()
- func (opt *Options) ListHeaders()
- func (opt *Options) Merge(src Options)
- func (opt *Options) SetProtocolScheme(scheme string)
- type UniqueIdentifierType
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 UniqueIdentifier UniqueIdentifierType // Internal trace or identifier for the request Writer io.WriteCloser // Define a custom resource you will write to other than the bytes.Buffer i.e.: a file }
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) FileWriter ¶ added in v0.4.0
func (*Options) GenerateIdentifier ¶ added in v0.4.0
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 ¶
type UniqueIdentifierType ¶ added in v0.4.0
type UniqueIdentifierType string
const ( IdentifierNone UniqueIdentifierType = "" IdentifierUUID UniqueIdentifierType = "uuid" IdentifierULID UniqueIdentifierType = "ulid" )
Click to show internal directories.
Click to hide internal directories.