r

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	Client *http.Client
}

HttpClient 封装一个HTTP请求

func NewHttpClient

func NewHttpClient() *HttpClient

NewHttpClient 创建一个HttpClient实例

func (*HttpClient) GetWithContext

func (c *HttpClient) GetWithContext(ctx context.Context, url string, headers map[string]string) (string, error)

Get 请求第三方接口(支持 context)

func (*HttpClient) PostWithContext

func (c *HttpClient) PostWithContext(ctx context.Context, url string, headers map[string]string, body []byte) (string, error)

Post 请求第三方接口(支持 context)

Jump to

Keyboard shortcuts

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