http_client

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy(client *Client)

Types

type Client

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

func New

func New() *Client

func (*Client) NewRequest

func (client *Client) NewRequest(opts ...NewRequestOption) *Request

type NewRequestOption

type NewRequestOption func(client *Client)

func WithNewRequestTimeout

func WithNewRequestTimeout(timeout time.Duration) NewRequestOption

type Request

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

func (*Request) Delete

func (request *Request) Delete(url string, opts ...RequestOption) (*Response, error)

func (*Request) Get

func (request *Request) Get(url string, opts ...RequestOption) (*Response, error)

func (*Request) Post

func (request *Request) Post(url string, body any, opts ...RequestOption) (*Response, error)

func (*Request) Put

func (request *Request) Put(url string, body any, opts ...RequestOption) (*Response, error)

func (*Request) SetFiles

func (request *Request) SetFiles(files map[string]string)

func (*Request) SetFormData

func (request *Request) SetFormData(data map[string]string)

func (*Request) SetHeaders

func (request *Request) SetHeaders(headers map[string]string)

func (*Request) SetPathParams

func (request *Request) SetPathParams(pathParams map[string]string)

func (*Request) SetQueryParams

func (request *Request) SetQueryParams(queryParams map[string]string)

type RequestOption

type RequestOption func(request *Request)

func WithRequestFiles

func WithRequestFiles(files map[string]string) RequestOption

func WithRequestFormData

func WithRequestFormData(data map[string]string) RequestOption

func WithRequestHeaders

func WithRequestHeaders(headers map[string]string) RequestOption

func WithRequestPathParams

func WithRequestPathParams(pathParams map[string]string) RequestOption

func WithRequestQueryParams

func WithRequestQueryParams(queryParams map[string]string) RequestOption

type Response

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

func (*Response) Body

func (response *Response) Body() []byte

func (*Response) Json

func (response *Response) Json(resp any) error

Jump to

Keyboard shortcuts

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