curl

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyResponse = errors.New("empty response")
)

Functions

This section is empty.

Types

type Instance added in v1.1.7

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

Instance simple wrapper of http.Client

func New added in v1.0.0

func New() *Instance

func (*Instance) Delete added in v1.1.7

func (c *Instance) Delete(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)

Delete send delete request

func (*Instance) Get added in v1.1.7

Get send get request

func (*Instance) Post added in v1.1.7

func (c *Instance) Post(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)

Post send post request

func (*Instance) PostFile added in v1.1.7

func (c *Instance) PostFile(ctx context.Context, url string, files map[string]string, params map[string]string) (serializer.Serializer, error)

PostFile send post request with file

func (*Instance) Put added in v1.1.7

func (c *Instance) Put(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)

Put send put request

func (*Instance) ReadResponse added in v1.1.7

func (c *Instance) ReadResponse(resp *http.Response) (serializer.Serializer, error)

ReadResponse reads body from the *http.Response

func (*Instance) Send added in v1.1.7

func (c *Instance) Send(ctx context.Context, request *http.Request) (serializer.Serializer, error)

Send return Response by http.Request

func (*Instance) WithHttpClient added in v1.1.7

func (c *Instance) WithHttpClient(httpClient *http.Client) *Instance

WithHttpClient sets the http client

func (*Instance) WithTracer added in v1.1.7

func (c *Instance) WithTracer(tracer *tracer.Instance) *Instance

Jump to

Keyboard shortcuts

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