http

package
v0.0.0-...-0662ccb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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) Delete

func (client *HttpClient) Delete(path string, query url.Values, headers map[string][]string) (*Response, error)

func (*HttpClient) Get

func (client *HttpClient) Get(path string, query url.Values, headers map[string][]string) (*Response, error)

func (*HttpClient) GetProxy

func (client *HttpClient) GetProxy() *url.URL

func (*HttpClient) GetTransport

func (client *HttpClient) GetTransport() *http.Transport

func (*HttpClient) Head

func (client *HttpClient) Head(path string, query url.Values, headers map[string][]string) (*Response, error)

func (*HttpClient) Options

func (client *HttpClient) Options(path string, query url.Values, headers map[string][]string) (*Response, error)

func (*HttpClient) Patch

func (client *HttpClient) Patch(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func (*HttpClient) PatchJSON

func (client *HttpClient) PatchJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

func (*HttpClient) Post

func (client *HttpClient) Post(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func (*HttpClient) PostJSON

func (client *HttpClient) PostJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

func (*HttpClient) Put

func (client *HttpClient) Put(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func (*HttpClient) PutJSON

func (client *HttpClient) PutJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

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

type Response

type Response struct {
	// contains filtered or unexported fields
}

func Delete

func Delete(path string, query url.Values, headers map[string][]string) (*Response, error)

func Get

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

func Options(path string, query url.Values, headers map[string][]string) (*Response, error)

func Patch

func Patch(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func PatchJSON

func PatchJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

func Post

func Post(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func PostJSON

func PostJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

func Put

func Put(path string, query url.Values, body io.Reader, headers map[string][]string) (*Response, error)

func PutJSON

func PutJSON(path string, query url.Values, object interface{}, headers map[string][]string) (*Response, error)

func (*Response) Bytes

func (resp *Response) Bytes() ([]byte, error)

func (*Response) Close

func (resp *Response) Close() error

func (*Response) Header

func (resp *Response) Header(key string) string

func (*Response) Headers

func (resp *Response) Headers() http.Header

func (*Response) JSON

func (resp *Response) JSON(object interface{}) error

func (*Response) JSONMapper

func (resp *Response) JSONMapper(data interface{}) error

func (*Response) RawURL

func (resp *Response) RawURL() string

func (*Response) StatusCode

func (resp *Response) StatusCode() int

func (*Response) String

func (resp *Response) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL