Ai
1 Star 0 Fork 0

小于的个人工具集/https

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
with_option.go 640 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaoyutab 提交于 2023-12-13 10:56 +08:00 . 添加网络请求的初步请求方法
package https
import "time"
// 设置跳过https证书验证
//
// c 是否跳过
func WithHttpsContinue(c bool) OptionFunc {
return func(c *Option) {
c.https_continue = true
}
}
// 设置请求的超时时间
//
// t 设置超时时间
func WithTimeOut(t time.Duration) OptionFunc {
return func(c *Option) {
c.time_out = t
}
}
// 设置缓存时间
//
// t 设置缓存时间,0表示不设置缓存
func WithCache(t time.Duration) OptionFunc {
return func(c *Option) {
c.cache_time = t
}
}
func WithIgnoreHeader(k string) OptionFunc {
return func(c *Option) {
c.ignore_header = append(c.ignore_header, "accept")
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/xgotool/https.git
git@gitee.com:xgotool/https.git
xgotool
https
https
v0.0.1

搜索帮助