request

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(req *Request)

func SetBody

func SetBody(body interface{}) Opt

func SetClient

func SetClient(client restclient.RestClient) Opt

func SetHeaders

func SetHeaders(headers map[string]string) Opt

func SetMethod

func SetMethod(method string) Opt

func SetParams added in v0.1.2

func SetParams(params map[string]string) Opt

type Request

type Request struct {
	C restclient.RestClient
	// contains filtered or unexported fields
}

func New added in v0.1.2

func New(opts ...Opt) *Request

func (*Request) Delete

func (req *Request) Delete(url string, result interface{}) (int, error)

func (*Request) Exchange

func (req *Request) Exchange(url string, result interface{}) (int, error)

func (*Request) Get

func (req *Request) Get(url string, result interface{}) (int, error)

func (*Request) Head

func (req *Request) Head(url string, result interface{}) (int, error)

func (*Request) Options

func (req *Request) Options(url string, result interface{}) (int, error)

func (*Request) Patch

func (req *Request) Patch(url string, result interface{}) (int, error)

func (*Request) Post

func (req *Request) Post(url string, result interface{}) (int, error)

func (*Request) Put

func (req *Request) Put(url string, result interface{}) (int, error)

func (*Request) SetBody added in v0.1.2

func (req *Request) SetBody(body interface{}) *Request

func (*Request) SetClient added in v0.1.2

func (req *Request) SetClient(client restclient.RestClient) *Request

func (*Request) SetHeaders added in v0.1.2

func (req *Request) SetHeaders(headers map[string]string) *Request

func (*Request) SetMethod added in v0.1.2

func (req *Request) SetMethod(method string) *Request

func (*Request) SetParams added in v0.1.2

func (req *Request) SetParams(params map[string]string) *Request

Jump to

Keyboard shortcuts

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