httpc

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJsonBody

func GetJsonBody(body interface{}) (buf io.ReadWriter, err error)

Types

type RateLimitError

type RateLimitError struct {
	Method string
	URL    string
	Err    error
}

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

type Request

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

func NewRequest

func NewRequest(baseUrl string, headers map[string]string) *Request

func (*Request) Delete

func (r *Request) Delete(ctx context.Context, result interface{}, path string) error

func (*Request) Execute

func (r *Request) Execute(ctx context.Context, method string, url string, body io.Reader, result interface{}) error

func (*Request) ExecuteRaw

func (r *Request) ExecuteRaw(ctx context.Context, method string, url string, body io.Reader, result *bytes.Buffer) error

func (*Request) Get

func (r *Request) Get(ctx context.Context, result interface{}, path string, query url.Values) error

func (*Request) GetBase

func (r *Request) GetBase(path string) string

func (*Request) GetRaw

func (r *Request) GetRaw(ctx context.Context, result *bytes.Buffer, path string, query url.Values) error

func (*Request) Patch

func (r *Request) Patch(ctx context.Context, result interface{}, path string, body interface{}) error

func (*Request) Post

func (r *Request) Post(ctx context.Context, result interface{}, path string, body interface{}) error

func (*Request) PostWithOutEncoded

func (r *Request) PostWithOutEncoded(ctx context.Context, result interface{}, path string, body interface{}) error

func (*Request) PostWithPlain

func (r *Request) PostWithPlain(ctx context.Context, result interface{}, path string, body io.Reader) error

func (*Request) PostWithXWWWFormUrlencoded

func (r *Request) PostWithXWWWFormUrlencoded(ctx context.Context, result interface{}, path string, body interface{}) error

func (*Request) SetBaseUrl

func (r *Request) SetBaseUrl(url string)

func (*Request) SetHeader

func (r *Request) SetHeader(k, v string)

func (*Request) SetRateLimit

func (r *Request) SetRateLimit(qps float64, burst int)

Jump to

Keyboard shortcuts

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