Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ContentTypeBinary for binary Content-Type ContentTypeBinary = "application/octet-stream" // ContentTypeForm for URL encoded form Content-Type ContentTypeForm = "application/x-www-form-urlencoded" // ContentTypeJSON for JSON Content-Type ContentTypeJSON = "application/json; charset=utf-8" // ContentTypeHTML for HTML Content-Type ContentTypeHTML = "text/html; charset=utf-8" // ContentTypeText for text Content-Type ContentTypeText = "text/plain; charset=utf-8" )
View Source
const DefaultTimeout = time.Duration(5 * time.Second)
DefaultTimeout is the default HTTP request timeout
View Source
const UserAgent = "Mozilla/5.0 (compatible; Feedpushr/1.0; +https://github.com/ncarlier/feedpushr)"
UserAgent used by HTTP client
Variables ¶
View Source
var DefaultClient = &http.Client{ Timeout: DefaultTimeout, Transport: DefaultTransport, }
DefaultClient is the default HTTP client with timeout
View Source
var DefaultTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 5 * time.Second, KeepAlive: 15 * time.Second, }).DialContext, MaxIdleConns: 50, IdleConnTimeout: 20 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }
DefaultTransport is the default HTTP client transport
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.