request

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCanNotMarshal = errors.New(`can't marshal (implement encoding.BinaryMarshaler)`)
)

Functions

This section is empty.

Types

type Request

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

func Connect

func Connect(url string) (*Request, error)

Connect generate a new request of http.MethodConnect

func Delete

func Delete(url string) (*Request, error)

Delete generate a new request of http.MethodDelete

func Get

func Get(url string) (*Request, error)

Get generate a new request of http.MethodGet

func Head(url string) (*Request, error)

Head generate a new request of http.MethodHead

func New

func New(method, uri string) (*Request, error)

New base method of new request

func Options

func Options(url string) (*Request, error)

Options generate a new request of http.MethodOptions

func Patch

func Patch(url string) (*Request, error)

Patch generate a new request of http.MethodPatch

func Post

func Post(url string) (*Request, error)

Post generate a new request of http.MethodPost

func Put

func Put(url string) (*Request, error)

Put generate a new request of http.MethodPut

func Trace

func Trace(url string) (*Request, error)

Trace generate a new request of http.MethodTrace

func (*Request) Body

func (r *Request) Body(body interface{}) (err error)

func (*Request) Form

func (r *Request) Form(options ...form.Option) (err error)

func (*Request) GetBody

func (r *Request) GetBody() io.Reader

func (*Request) GetHeader

func (r *Request) GetHeader(key string) (value []string, ok bool)

func (*Request) GetHeaders

func (r *Request) GetHeaders() http.Header

func (*Request) GetMethod

func (r *Request) GetMethod() string

func (*Request) GetUrl

func (r *Request) GetUrl() string

func (*Request) Json

func (r *Request) Json(body interface{}) (err error)

func (*Request) MultiForm

func (r *Request) MultiForm(options ...multipart_form.Option) (err error)

func (*Request) SetHeader

func (r *Request) SetHeader(key string, value ...string)

func (*Request) Xml

func (r *Request) Xml(body interface{}) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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