|
|
@ -38,6 +38,7 @@ type options struct {
|
|
|
|
unTar bool
|
|
|
|
unTar bool
|
|
|
|
insecureSkipVerifyTLS bool
|
|
|
|
insecureSkipVerifyTLS bool
|
|
|
|
plainHTTP bool
|
|
|
|
plainHTTP bool
|
|
|
|
|
|
|
|
acceptHeader string
|
|
|
|
username string
|
|
|
|
username string
|
|
|
|
password string
|
|
|
|
password string
|
|
|
|
passCredentialsAll bool
|
|
|
|
passCredentialsAll bool
|
|
|
@ -60,6 +61,13 @@ func WithURL(url string) Option {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// WithAcceptHeader sets the request's Accept header as some REST APIs serve multiple content types
|
|
|
|
|
|
|
|
func WithAcceptHeader(header string) Option {
|
|
|
|
|
|
|
|
return func(opts *options) {
|
|
|
|
|
|
|
|
opts.acceptHeader = header
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// WithBasicAuth sets the request's Authorization header to use the provided credentials
|
|
|
|
// WithBasicAuth sets the request's Authorization header to use the provided credentials
|
|
|
|
func WithBasicAuth(username, password string) Option {
|
|
|
|
func WithBasicAuth(username, password string) Option {
|
|
|
|
return func(opts *options) {
|
|
|
|
return func(opts *options) {
|
|
|
|