gokhttp_requests

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteOpts

func ExecuteOpts(req *http.Request, opts ...Option) error

func MakeCONNECTRequest added in v0.3.1

func MakeCONNECTRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeCONNECTRequest Makes a CONNECT request

func MakeDELETERequest added in v0.3.1

func MakeDELETERequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeDELETERequest Makes a DELETE request

func MakeGETRequest

func MakeGETRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeGETRequest Makes a GET request

func MakeHEADRequest

func MakeHEADRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeHEADRequest Makes a HEAD request

func MakeOPTIONSRequest added in v0.3.1

func MakeOPTIONSRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeOPTIONSRequest Makes a OPTIONS request

func MakePATCHRequest added in v0.3.1

func MakePATCHRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakePATCHRequest Makes a PATCH request

func MakePOSTRequest

func MakePOSTRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakePOSTRequest Makes a POST request

func MakePUTRequest added in v0.3.1

func MakePUTRequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakePUTRequest Makes a PUT request

func MakeTRACERequest added in v0.3.1

func MakeTRACERequest(ctx context.Context, httpURL string, opts ...Option) (*http.Request, error)

MakeTRACERequest Makes a TRACE request

Types

type HeaderOption

type HeaderOption struct {
	Headers http.Header
	Replace bool
}

func NewHeaderOption

func NewHeaderOption(headers http.Header) *HeaderOption

func NewHeaderOptionFromMap

func NewHeaderOptionFromMap(headers map[string]string) *HeaderOption

func (*HeaderOption) Execute

func (o *HeaderOption) Execute(req *http.Request) error

type Option

type Option interface {
	Execute(r *http.Request) error
}

type POSTRawOption

type POSTRawOption struct {
	Body          io.ReadCloser
	ContentLength int64
	ContentType   string
}

func NewPOSTFormOption

func NewPOSTFormOption(values url.Values) *POSTRawOption

func NewPOSTFormOptionFromMap

func NewPOSTFormOptionFromMap(values map[string]string) *POSTRawOption

func NewPOSTJSONOption added in v0.2.6

func NewPOSTJSONOption(data []byte, isUTF8 bool) *POSTRawOption

func NewPOSTJSONOptionFromReader added in v0.2.6

func NewPOSTJSONOptionFromReader(data io.Reader, length int, isUTF8 bool) *POSTRawOption

func NewPOSTMultipartOption

func NewPOSTMultipartOption(writer *gokhttp_multipart.Wrapper) *POSTRawOption

func NewPOSTRawOption

func NewPOSTRawOption(data io.Reader, contentType string, contentLength int64) *POSTRawOption

func (*POSTRawOption) Execute

func (o *POSTRawOption) Execute(req *http.Request) error

type RawURLParamOption

type RawURLParamOption struct {
	RawQuery string
}

func NewRawURLParamOption

func NewRawURLParamOption(rawQuery string) *RawURLParamOption

func (*RawURLParamOption) Execute

func (o *RawURLParamOption) Execute(req *http.Request) error

type URLParamOption

type URLParamOption struct {
	Values url.Values
}

func NewURLParamOption

func NewURLParamOption(values url.Values) *URLParamOption

func NewURLParamOptionFromMap

func NewURLParamOptionFromMap(values map[string]string) *URLParamOption

func (*URLParamOption) Execute

func (o *URLParamOption) Execute(req *http.Request) error

Jump to

Keyboard shortcuts

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