curl

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidResponse = errors.New("the response is invalid")
)

Functions

This section is empty.

Types

type CURL

type CURL struct {
	Request  *http.Request
	Response *http.Response
	Error    error
}

Request ...

func Get

func Get(url string) *CURL

Get ...

func New

func New(method, url string, body io.Reader) *CURL

New ...

func Post

func Post(url string, body io.Reader) *CURL

Post ...

func PostJSON

func PostJSON(url string, x interface{}) *CURL

PostJSON ...

func (*CURL) ReadBytes

func (c *CURL) ReadBytes() ([]byte, error)

ReadBytes ...

func (*CURL) ReadJSON

func (c *CURL) ReadJSON(x interface{}) error

ReadJSON ...

func (*CURL) Send

func (c *CURL) Send() *CURL

Send ...

func (*CURL) SetHeader

func (c *CURL) SetHeader(key, value string) *CURL

SetHeader ...

func (*CURL) SetHeaderList

func (c *CURL) SetHeaderList(vstr ...string) *CURL

SetHeaderList ...

func (*CURL) SetURLQuery added in v0.1.5

func (c *CURL) SetURLQuery(value url.Values) *CURL

Jump to

Keyboard shortcuts

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