Documentation
¶
Overview ¶
Package request contains functions to build an HTTP request from a template.
Index ¶
Constants ¶
View Source
const LongHelp = `` /* 406-byte string literal not displayed */
LongHelp is a text which describes how constructing a request works. It is typically used in the long help text.
Variables ¶
View Source
var DefaultHeader = http.Header{ "Accept": []string{"*/*"}, "User-Agent": []string{"monsoon"}, }
DefaultHeader contains all HTTP header values that are added by default. If the header is already present, it is not added.
Functions ¶
Types ¶
type Header ¶
type Header struct { Header http.Header Remove map[string]struct{} // entries are to be removed before sending the HTTP request }
Header is an HTTP header that implements the pflag.Value interface.
func (Header) Apply ¶
Apply applies the values in h to the target http.Header. The function insertValue is called for all names and values before adding them.
type Request ¶
type Request struct { URL string Method string Header *Header Body string UserPass string // user:password for HTTP basic auth TemplateFile string // used to read the request from a file Names []string // these string are being replaced by a value in a specific http request ForceChunkedEncoding bool // contains filtered or unexported fields }
Request is a template for an HTTP request.
Click to show internal directories.
Click to hide internal directories.