http_utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 8 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
}

func NewHTTPClient

func NewHTTPClient() *HTTPClient

func (*HTTPClient) SendRequest

func (c *HTTPClient) SendRequest(r *HTTPRequest) ([]byte, error)

SendRequest 发送HTTP请求并读取响应数据

type HTTPRequest

type HTTPRequest struct {
	Method      string
	APIUrl      string
	Query       map[string]string
	Header      map[string]string
	ContentType string
	Body        any
}

HTTPRequest 包含apiUrl和headers

func NewHTTPRequest

func NewHTTPRequest(method, apiUrl string, query, header map[string]string, contentType string, body any) *HTTPRequest

Jump to

Keyboard shortcuts

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