1 Star 0 Fork 0

窦雪峰 / go-common

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
request.go 498 Bytes
一键复制 编辑 原始数据 按行查看 历史
douxuefeng 提交于 2020-12-01 16:50 . create office menu
/*
@Time : 2020/9/26 13:00
@Author : douxuefeng
@File : request
@Desc:
*/
package go_common
import (
"crypto/tls"
"github.com/go-resty/resty/v2"
)
type CertConfig struct{
CertFile, KeyFile string
}
type Request struct {
}
func NewRequest() *resty.Request {
client := resty.New()
return client.R()
}
func NewCertRequest(data *CertConfig) *resty.Request {
client := resty.New()
cert, _ := tls.LoadX509KeyPair(data.CertFile, data.KeyFile)
client.SetCertificates(cert)
return client.R()
}
Go
1
https://gitee.com/douxuefeng/go-common.git
git@gitee.com:douxuefeng/go-common.git
douxuefeng
go-common
go-common
dev

搜索帮助