http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResToObj

func ResToObj(resp *Response, target any) error

Types

type Client

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

func NewHttpClient

func NewHttpClient() *Client

func (*Client) Get

func (c *Client) Get(ctx context.Context, url string) (*Response, error)

func (*Client) GetHeader

func (c *Client) GetHeader(k string) string

func (*Client) GetWithReader

func (c *Client) GetWithReader(ctx context.Context, url string) ([]byte, error)

func (*Client) Post

func (c *Client) Post(ctx context.Context, url string, body io.Reader) (*Response, error)

func (*Client) SetHeader

func (c *Client) SetHeader(k, v string)

type Response

type Response struct {
	*http.Response
}

Jump to

Keyboard shortcuts

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