http

package
v0.0.0-...-3eb6894 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2016 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &http.Client{Transport: DefaultTransport}
View Source
var DefaultDialer = &net.Dialer{Timeout: 10000 * time.Millisecond}
View Source
var DefaultTransport http.RoundTripper = &http.Transport{Dial: DefaultDialer.Dial, Proxy: http.ProxyFromEnvironment}

Functions

func Deflate

func Deflate() *compression

func Gzip

func Gzip() *compression

func SetConnectTimeout

func SetConnectTimeout(duration time.Duration)

func Zlib

func Zlib() *compression

Types

type Body

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

func (*Body) Close

func (b *Body) Close() error

func (*Body) Read

func (b *Body) Read(p []byte) (int, error)

func (*Body) ToString

func (b *Body) ToString() (string, error)

func (*Body) Unmarshal

func (b *Body) Unmarshal(o interface{}) error

type Error

type Error struct {
	Err error
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Timeout

func (e *Error) Timeout() bool

type Request

type Request struct {
	Method            string
	Uri               string
	Body              interface{}
	QueryString       interface{}
	Timeout           time.Duration
	Multipart         bool
	ContentType       string
	Accept            string
	Host              string
	UserAgent         string
	Insecure          bool
	MaxRedirects      int
	RedirectHeaders   bool
	Proxy             string
	Compression       *compression
	BasicAuthUsername string
	BasicAuthPassword string
	CookieJar         http.CookieJar
	ShowDebug         bool
	OnBeforeRequest   func(request *Request, httpreq *http.Request)
	// contains filtered or unexported fields
}

func (*Request) AddCookie

func (r *Request) AddCookie(c *http.Cookie)

func (*Request) AddHeader

func (r *Request) AddHeader(name string, value string)

func (Request) Do

func (r Request) Do() (*Response, error)

func (Request) NewRequest

func (r Request) NewRequest() (*http.Request, error)

func (Request) WithCookie

func (r Request) WithCookie(c *http.Cookie) Request

func (Request) WithHeader

func (r Request) WithHeader(name string, value string) Request

type Response

type Response struct {
	*http.Response
	Uri  string
	Body *Body
	// contains filtered or unexported fields
}

func (Response) CancelRequest

func (r Response) CancelRequest()

Jump to

Keyboard shortcuts

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