Documentation ¶
Overview ¶
Package http implements a set of utilities related to the HTTP protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Insecure bool // contains filtered or unexported fields }
Client is a HTTP Client :)
func NewClientWithAuthorization ¶
NewClientWithAuthorization returns a new client with a custom authorization header.
func NewClientWithCacheHeaders ¶
NewClientWithCacheHeaders returns a new HTTP client that send cache headers.
func NewClientWithCredentials ¶
NewClientWithCredentials returns a new HTTP client that requires authentication.
type Response ¶
type Response struct { Body io.Reader StatusCode int EffectiveURL string LastModified string ETag string ContentType string ContentLength int64 }
Response wraps a server response.
func (*Response) HasServerFailure ¶
HasServerFailure returns true if the status code represents a failure.
func (*Response) IsModified ¶
IsModified returns true if the resource has been modified.
func (*Response) NormalizeBodyEncoding ¶
NormalizeBodyEncoding make sure the body is encoded in UTF-8.
If a charset other than UTF-8 is detected, we convert the document to UTF-8. This is used by the scraper and feed readers.
Do not forget edge cases: - Some non-utf8 feeds specify encoding only in Content-Type, not in XML document.