httpx

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v1.3.7

type Option func(req *Request) error

func Body added in v1.3.7

func Body(body interface{}) Option

func ContentType added in v1.3.7

func ContentType(contentType string) Option
func Header(name, value string) Option

func HttpHeader added in v1.4.1

func HttpHeader(header http.Header) Option

func MapHeader added in v1.4.1

func MapHeader(header map[string]string) Option

func MapQuery added in v1.4.1

func MapQuery(values map[string]interface{}) Option

func PathVar added in v1.4.1

func PathVar(key string, value interface{}) Option

func Query added in v1.4.1

func Query(name, value string) Option

func QueryValues added in v1.4.1

func QueryValues(values url.Values) Option

func Timeout added in v1.4.1

func Timeout(t time.Duration) Option

type Request added in v1.3.7

type Request struct {
	Method     string
	URL        *url.URL
	Body       interface{}
	BodyReader io.Reader
	Param      url.Values
	Header     http.Header
	Timeout    time.Duration
}

func NewRequest added in v1.4.1

func NewRequest(method string, URL string, options ...Option) (*Request, error)

func (*Request) Curl added in v1.3.7

func (r *Request) Curl() string

func (*Request) Do added in v1.4.1

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

func (*Request) WithOption added in v1.4.1

func (r *Request) WithOption(options ...Option) error

type Response added in v1.3.7

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

func Delete added in v1.4.1

func Delete(url string, options ...Option) (*Response, error)

func Get added in v1.4.1

func Get(url string, options ...Option) (*Response, error)

func Options added in v1.4.1

func Options(url string, options ...Option) (*Response, error)

func Patch added in v1.4.1

func Patch(url string, options ...Option) (*Response, error)

func Post added in v1.4.1

func Post(url string, options ...Option) (*Response, error)

func Put added in v1.4.1

func Put(url string, options ...Option) (*Response, error)

func Trace added in v1.4.1

func Trace(url string, options ...Option) (*Response, error)

func (*Response) Bind added in v1.3.7

func (r *Response) Bind(o interface{}) error

func (*Response) Data added in v1.3.7

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

func (*Response) DataString added in v1.3.7

func (r *Response) DataString() string

Jump to

Keyboard shortcuts

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