httputils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 6 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 {
	// contains filtered or unexported fields
}

HTTPClient 定义一个 HTTP 客户端工具类

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *HTTPClient

NewHTTPClient 创建一个新的 HTTP 客户端

func (*HTTPClient) GET

func (h *HTTPClient) GET(url string, headers map[string]string) (string, error)

GET 发送 GET 请求

func (*HTTPClient) POST

func (h *HTTPClient) POST(url string, headers map[string]string, data interface{}) (string, error)

POST 发送 POST 请求(支持 JSON 数据)

Jump to

Keyboard shortcuts

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