Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHeaders = map[string]string{
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Referer": "https://duckduckgo.com/",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0",
}
DefaultHeaders defines the headers that will be injected into every outgoing request in order to simulate the appearance of a real web browser.
Not very sportsmanlike, but basically effective at letting us fetch page titles.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Transport)
Option customizes a Transport.
func WithHeaders ¶
WithHeaders overrides the default set of headers injected into each request.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an http.RoundTripper implementation that injects a set of headers into every outgoing request in order to fake the appearance of a real web browser making the request.
Click to show internal directories.
Click to hide internal directories.