Documentation ¶
Overview ¶
Package httpclient provides a simple http client interface to access web resource.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a simple wrap of http client. It provides a simple way to handle cookies, UA, and timeouts.
type Options ¶
type Options struct { // Proxy sets a http proxy. It uses environments if is empty. // The proxy type is determined by the URL scheme. "http", // "https", and "socks5" are supported. If the scheme is empty, // "http" is assumed. Proxy string // UA of HTTP request header User-Agent. UA string // Timeout of HTTP request. Timeout time.Duration }
Options for creating a Client.
type Request ¶
A Request represents an HTTP request received by a server or to be sent by a client. It contains a vlaid request if Err != nil.
type Response ¶
Response represents the response from an HTTP request. It contains a valid http response if Err != nil.
func (*Response) Drop ¶
Drop drop the response body and return a nil. It also returns error if HTTP response status code is not 200.
Click to show internal directories.
Click to hide internal directories.