curl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Curl added in v1.0.0

type Curl interface {
	Get(url string) (Response, error)
	Post(url string, body io.Reader) (Response, error)
	Put(url string, body io.Reader) (Response, error)
	Patch(url string, body io.Reader) (Response, error)
	Delete(url string) (Response, error)
	PostFile(url string, files map[string]string, params map[string]string) (Response, error)
	Send(request *http.Request) (Response, error)
}

Curl

func Default added in v1.0.0

func Default() Curl

func New added in v1.0.0

func New(opts ...Option) Curl

type Option added in v1.0.0

type Option interface {
	// contains filtered or unexported methods
}

func WithTimeout added in v1.0.0

func WithTimeout(timeout time.Duration) Option

type Response added in v1.0.0

type Response interface {
	String() string
	Byte() []byte
	BindJson(object interface{}) error
	Reader() io.Reader
}

Response

func Delete

func Delete(url string) (Response, error)

func Get

func Get(url string) (Response, error)

func Patch

func Patch(url string, body io.Reader) (Response, error)

func Post

func Post(url string, body io.Reader) (Response, error)

func PostFile added in v1.0.0

func PostFile(url string, files map[string]string, params map[string]string) (Response, error)

func Put

func Put(url string, body io.Reader) (Response, error)

func Send added in v1.0.0

func Send(request *http.Request) (Response, error)

Jump to

Keyboard shortcuts

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