package goreq
import "github.com/franela/goreq"
Index ¶
- Variables
- func Deflate() *compression
- func Gzip() *compression
- func SetConnectTimeout(duration time.Duration)
- func Zlib() *compression
- type Body
- func (b *Body) Close() error
- func (b *Body) FromJsonTo(o interface{}) error
- func (b *Body) Read(p []byte) (int, error)
- func (b *Body) ToString() (string, error)
- type Error
- type Request
- func (r *Request) AddCookie(c *http.Cookie)
- func (r *Request) AddHeader(name string, value string)
- func (r *Request) AddProxyConnectHeader(name string, value string)
- func (r Request) Do() (*Response, error)
- func (r Request) NewRequest() (*http.Request, error)
- func (r Request) WithCookie(c *http.Cookie) Request
- func (r Request) WithHeader(name string, value string) Request
- func (r Request) WithProxyConnectHeader(name string, value string) Request
- type Response
Variables ¶
var DefaultDialer = &net.Dialer{Timeout: 1000 * time.Millisecond}
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 Zlib ¶
func Zlib() *compression
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
func (*Body) Close ¶
func (*Body) FromJsonTo ¶
func (*Body) Read ¶
func (*Body) ToString ¶
type Error ¶
type Error struct { Err error // contains filtered or unexported fields }
func (*Error) Error ¶
func (*Error) Timeout ¶
type Request ¶
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 ¶
func (*Request) AddHeader ¶
func (*Request) AddProxyConnectHeader ¶
func (Request) Do ¶
func (Request) NewRequest ¶
func (Request) WithCookie ¶
func (Request) WithHeader ¶
func (Request) WithProxyConnectHeader ¶
type Response ¶
type Response struct { *http.Response Uri string Body *Body // contains filtered or unexported fields }
func (Response) CancelRequest ¶
func (r Response) CancelRequest()
Source Files ¶
- Version
- v0.0.0-20171204163338-bcd34c9993f8 (latest)
- Published
- Dec 4, 2017
- Platform
- js/wasm
- Imports
- 19 packages
- Last checked
- 3 weeks ago –
Tools for package owners.