gorequests

package module
v0.0.0-...-80b5f3d Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type H

type H map[string]string

type Request

type Request struct {
	Url         string
	Params      map[string]string
	Method      string
	Headers     H
	Body        []byte
	ContentType string
	Cookies     []*http.Cookie
	Timeout     time.Duration
	// contains filtered or unexported fields
}

func Delete

func Delete(url string) *Request

func Get

func Get(url string) *Request
func Head(url string) *Request

func NewRequest

func NewRequest() *Request

func Options

func Options(url string) *Request

func Patch

func Patch(url string) *Request

func Post

func Post(url string) *Request

func Put

func Put(url string) *Request

func (*Request) AddParams

func (r *Request) AddParams(key, value string) *Request

func (*Request) Cancel

func (r *Request) Cancel() bool

func (*Request) CookieAdd

func (r *Request) CookieAdd(cookies ...*http.Cookie) *Request

func (*Request) Delete

func (r *Request) Delete(url string) *Request

func (*Request) Get

func (r *Request) Get(url string) *Request

func (*Request) Head

func (r *Request) Head(url string) *Request

func (*Request) HeaderAdd

func (r *Request) HeaderAdd(key, value string) *Request

func (*Request) HeaderClear

func (r *Request) HeaderClear() *Request

func (*Request) HeaderRemove

func (r *Request) HeaderRemove(key string) *Request

func (*Request) Options

func (r *Request) Options(url string) *Request

func (*Request) Patch

func (r *Request) Patch(url string) *Request

func (*Request) Post

func (r *Request) Post(url string) *Request

func (*Request) Put

func (r *Request) Put(url string) *Request

func (*Request) Request

func (r *Request) Request(method, url string) *Request

func (*Request) SetBody

func (r *Request) SetBody(body []byte) *Request

func (*Request) SetContentType

func (r *Request) SetContentType(contentType string) *Request

func (*Request) SetHeaders

func (r *Request) SetHeaders(headers H) *Request

func (*Request) SetJson

func (r *Request) SetJson(data interface{}) *Request

func (*Request) Start

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

type Response

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

func (*Response) Data

func (r *Response) Data() []byte

func (*Response) Json

func (r *Response) Json(data interface{}) error

func (*Response) Text

func (r *Response) Text() string

type Session

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

func NewSession

func NewSession(headers H, proxy string) (*Session, error)

func (*Session) NewReq

func (s *Session) NewReq() *Request

func (*Session) SetTimeout

func (s *Session) SetTimeout(timeout time.Duration) *Session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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