request

package
v0.0.0-...-82a817b Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body func() (io.ReadCloser, error)

type Request

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

func New

func New(url string) *Request

func (*Request) Accept

func (r *Request) Accept(cts string) *Request

func (*Request) BasicAuth

func (r *Request) BasicAuth(username, password string) *Request

func (*Request) Bearer

func (r *Request) Bearer(token string) *Request

func (*Request) Body

func (r *Request) Body(b Body) *Request

func (*Request) BodyData

func (r *Request) BodyData(data []byte) *Request

func (*Request) BodyJSON

func (r *Request) BodyJSON(v interface{}) *Request

func (*Request) Build

func (r *Request) Build(ctx context.Context) (*http.Request, error)

func (*Request) Client

func (r *Request) Client(client *http.Client) *Request

func (*Request) ContentType

func (r *Request) ContentType(ct string) *Request

func (*Request) ContentTypeJSON

func (r *Request) ContentTypeJSON() *Request

func (*Request) Delete

func (r *Request) Delete() *Request

func (*Request) Execute

func (r *Request) Execute(ctx context.Context, afterDo func(error) error, handler func(*http.Response) error) error

func (*Request) Get

func (r *Request) Get() *Request

func (*Request) Header

func (r *Request) Header(key string, values ...string) *Request

func (*Request) ID

func (r *Request) ID(ID string) *Request

func (*Request) Method

func (r *Request) Method(method string) *Request

func (*Request) Param

func (r *Request) Param(key string, values ...string) *Request

func (*Request) Path

func (r *Request) Path(path string) *Request

func (*Request) Pathf

func (r *Request) Pathf(format string, a ...interface{}) *Request

func (*Request) Post

func (r *Request) Post() *Request

func (*Request) Put

func (r *Request) Put() *Request

func (*Request) UserAgent

func (r *Request) UserAgent(ua string) *Request

Jump to

Keyboard shortcuts

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