Help us shape the future of Go! Take the 2026 Go Developer Survey

httputils

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 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