Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient() *HTTPClient
func (*HTTPClient) GetByQuery ¶
func (c *HTTPClient) GetByQuery(r *HTTPRequest) ([]byte, error)
GetByQuery 发送一个HTTP GET请求到指定的URL,并附带查询参数
func (*HTTPClient) PostByForm ¶
func (c *HTTPClient) PostByForm(r *HTTPRequest) ([]byte, error)
PostByForm 发送一个带有表单数据的HTTP POST请求到指定的URL
func (*HTTPClient) PostByJson ¶
func (c *HTTPClient) PostByJson(r *HTTPRequest) ([]byte, error)
PostByJson 发送一个带有JSON数据的HTTP POST请求到指定的URL
type HTTPRequest ¶
HTTPRequest 包含apiUrl和headers
func NewHTTPRequest ¶
func NewHTTPRequest(apiUrl string, headers map[string]string, reqData any) *HTTPRequest
Click to show internal directories.
Click to hide internal directories.