Documentation
¶
Index ¶
- Constants
- Variables
- type HttpClient
- func (client *HttpClient) Close()
- func (client *HttpClient) Delete(path string, query url.Values, headers map[string][]string) (*Response, error)
- func (client *HttpClient) Get(path string, query url.Values, headers map[string][]string) (*Response, error)
- func (client *HttpClient) GetProxy() *url.URL
- func (client *HttpClient) GetTransport() *http.Transport
- func (client *HttpClient) Head(path string, query url.Values, headers map[string][]string) (*Response, error)
- func (client *HttpClient) Options(path string, query url.Values, headers map[string][]string) (*Response, error)
- func (client *HttpClient) Patch(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func (client *HttpClient) PatchJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func (client *HttpClient) Post(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func (client *HttpClient) PostJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func (client *HttpClient) Put(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func (client *HttpClient) PutJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func (client *HttpClient) SOCKS5(network string, addr string, auth *proxy.Auth, forward proxy.Dialer) (*HttpClient, error)
- func (client *HttpClient) SetBasicAuth(username string, password string) *HttpClient
- func (client *HttpClient) SetCookie(cookie *http.Cookie) *HttpClient
- func (client *HttpClient) SetCookies(cookies []*http.Cookie) *HttpClient
- func (client *HttpClient) SetHeader(key string, value string) *HttpClient
- func (client *HttpClient) SetHeaders(headers map[string]string) *HttpClient
- func (client *HttpClient) SetProxy(proxy *url.URL) *HttpClient
- func (client *HttpClient) SetTLSClientConfig(tlsConfig *tls.Config) *HttpClient
- func (client *HttpClient) SetTLSHandshakeTimeout(timeout time.Duration) *HttpClient
- func (client *HttpClient) SetTransport(transport *http.Transport) *HttpClient
- type Response
- func Delete(path string, query url.Values, headers map[string][]string) (*Response, error)
- func Get(path string, query url.Values, headers map[string][]string) (*Response, error)
- func Head(path string, query url.Values, headers map[string][]string) (*Response, error)
- func Options(path string, query url.Values, headers map[string][]string) (*Response, error)
- func Patch(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func PatchJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func Post(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func PostJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func Put(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)
- func PutJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)
- func (resp *Response) Bytes() ([]byte, error)
- func (resp *Response) Close() error
- func (resp *Response) Header(key string) string
- func (resp *Response) Headers() http.Header
- func (resp *Response) JSON(object interface{}) error
- func (resp *Response) JSONMapper(data interface{}) error
- func (resp *Response) RawURL() string
- func (resp *Response) StatusCode() int
- func (resp *Response) String() string
Constants ¶
View Source
const ResponseBodyAllSize int64 = 0
Variables ¶
View Source
var DefaultClient = NewClient()
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() *HttpClient
func NewWithClient ¶
func NewWithClient(client *http.Client) *HttpClient
func NewWithTimeout ¶
func NewWithTimeout(timeout time.Duration) *HttpClient
func (*HttpClient) Close ¶
func (client *HttpClient) Close()
func (*HttpClient) GetProxy ¶
func (client *HttpClient) GetProxy() *url.URL
func (*HttpClient) GetTransport ¶
func (client *HttpClient) GetTransport() *http.Transport
func (*HttpClient) SOCKS5 ¶
func (client *HttpClient) SOCKS5(network string, addr string, auth *proxy.Auth, forward proxy.Dialer) (*HttpClient, error)
func (*HttpClient) SetBasicAuth ¶
func (client *HttpClient) SetBasicAuth(username string, password string) *HttpClient
func (*HttpClient) SetCookie ¶
func (client *HttpClient) SetCookie(cookie *http.Cookie) *HttpClient
func (*HttpClient) SetCookies ¶
func (client *HttpClient) SetCookies(cookies []*http.Cookie) *HttpClient
func (*HttpClient) SetHeader ¶
func (client *HttpClient) SetHeader(key string, value string) *HttpClient
func (*HttpClient) SetHeaders ¶
func (client *HttpClient) SetHeaders(headers map[string]string) *HttpClient
func (*HttpClient) SetProxy ¶
func (client *HttpClient) SetProxy(proxy *url.URL) *HttpClient
func (*HttpClient) SetTLSClientConfig ¶
func (client *HttpClient) SetTLSClientConfig(tlsConfig *tls.Config) *HttpClient
func (*HttpClient) SetTLSHandshakeTimeout ¶
func (client *HttpClient) SetTLSHandshakeTimeout(timeout time.Duration) *HttpClient
func (*HttpClient) SetTransport ¶
func (client *HttpClient) SetTransport(transport *http.Transport) *HttpClient
Click to show internal directories.
Click to hide internal directories.