goreq: github.com/franela/goreq Index | Files

package goreq

import "github.com/franela/goreq"

Index

Package Files

goreq.go tags.go

Variables

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

func Deflate Uses

func Deflate() *compression

func Gzip Uses

func Gzip() *compression

func SetConnectTimeout Uses

func SetConnectTimeout(duration time.Duration)

func Zlib Uses

func Zlib() *compression

type Body Uses

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

func (*Body) Close Uses

func (b *Body) Close() error

func (*Body) FromJsonTo Uses

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

func (*Body) Read Uses

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

func (*Body) ToString Uses

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

type Error Uses

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

func (*Error) Error Uses

func (e *Error) Error() string

func (*Error) Timeout Uses

func (e *Error) Timeout() bool

type Request Uses

type Request struct {
    Method          string
    Uri             string
    Body            interface{}
    QueryString     interface{}
    Timeout         time.Duration
    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(goreq *Request, httpreq *http.Request)
    // contains filtered or unexported fields
}

func (*Request) AddCookie Uses

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

func (*Request) AddHeader Uses

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

func (*Request) AddProxyConnectHeader Uses

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

func (Request) Do Uses

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

func (Request) NewRequest Uses

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

func (Request) WithCookie Uses

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

func (Request) WithHeader Uses

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

func (Request) WithProxyConnectHeader Uses

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

type Response Uses

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

func (Response) CancelRequest Uses

func (r Response) CancelRequest()

Package goreq imports 19 packages (graph) and is imported by 137 packages. Updated 2017-12-04. Refresh now. Tools for package owners.