Documentation
¶
Index ¶
- func Delete(ctx context.Context, url string, headers map[string]string) (*http.Response, error)
- func DownloadFile(ctx context.Context, url, filePath string) error
- func Get(ctx context.Context, url string, headers map[string]string) (*http.Response, error)
- func GetJsonD(ctx context.Context, url string, d any, headers map[string]string) error
- func JsonV(resp *http.Response, v any) error
- func Post(ctx context.Context, url string, body io.Reader, headers map[string]string) (*http.Response, error)
- func PostJsonD(ctx context.Context, url string, body io.Reader, d any, ...) error
- func Request(ctx context.Context, method string, url string, body io.Reader, ...) (*http.Response, error)
- func UploadFile(ctx context.Context, url string, filePath string, fieldName string, ...) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
DownloadFile 下载远程文件到本地,支持断点续传
func Post ¶
func Post(ctx context.Context, url string, body io.Reader, headers map[string]string) (*http.Response, error)
Post 发送 JSON POST 请求,支持重试
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.