Documentation
¶
Index ¶
- type Http
- func (h *Http) ClearDefaultHeaders() *Http
- func (h *Http) Do(urlPath string, method string, headers map[string]string, body io.Reader) ([]byte, error)
- func (h *Http) Get(params url.Values, result any) error
- func (h *Http) PostForm(formData url.Values, result any) error
- func (h *Http) PostJSON(jsonData any, result any) error
- func (h *Http) PostMultipart(formBuilder func(w *multipart.Writer) error, result any) error
- func (h *Http) SetHeader(key, value string) *Http
- func (h *Http) SetTimeout(timeout time.Duration) *Http
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Http ¶
Http HTTP请求客户端
func (*Http) ClearDefaultHeaders ¶
ClearDefaultHeaders 清除默认请求头
func (*Http) Do ¶
func (h *Http) Do(urlPath string, method string, headers map[string]string, body io.Reader) ([]byte, error)
Do 执行HTTP请求
func (*Http) PostMultipart ¶
PostMultipart 发送 multipart/form-data 请求
Click to show internal directories.
Click to hide internal directories.