reqKit

package
v2.8.129 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsTimeoutError func(err error) (flag bool) = httpClientKit.IsTimeoutError

IsTimeoutError 是否是请求超时错误?

Functions

func DownloadToFile

func DownloadToFile(url, filePath string) error

func DownloadToWriter

func DownloadToWriter(url string, writer io.Writer) error

func GetDefaultClient

func GetDefaultClient() *req.Client

GetDefaultClient

重用Client https://req.cool/zh/docs/tutorial/best-practices/#%e9%87%8d%e7%94%a8-client

不要每次发请求都创建 Client,造成不必要的开销,通常可以复用同一 Client 发所有请求.

!!!: 不修改返回值的话,可以调用此方法;否则调用 NewClient.

func NewClient

func NewClient() *req.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

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