Documentation ¶
Index ¶
- Variables
- func AssertHttpStatusCodeSuccessful(statusCode int) error
- func Get(url string, params map[string]string) (int, []byte, error)
- func Post(url string, params map[string]string) (int, []byte, error)
- func SimpleGet(url string, params map[string]string) ([]byte, error)
- func SimplePost(url string, params map[string]string) ([]byte, error)
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTimeout 发送请求的默认超时时间. /* PS: (1) 个人实测,对于 http.Client 结构体,Timeout 默认为30s. (2) e.g. yozo的网访问谷歌必定超时. */ DefaultTimeout = time.Second * 6 )
Functions ¶
func Get ¶
Get 发送GET请求(可用于下载文件等场景)
@param params 请求参数,可以为nil @return http状态码 + 响应内容 + error
参考: golang 将图片生成Base64 https://blog.csdn.net/weixin_40292098/article/details/126029489
Types ¶
type ClientConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.