You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alipayopen/request.go

36 lines
680 B

2 years ago
package alipayopen
import (
"context"
"go.dtapp.net/gorequest"
"go.dtapp.net/gostring"
)
5 months ago
func (c *Client) request(ctx context.Context, param gorequest.Params) (gorequest.Response, error) {
2 years ago
// 签名
params := c.sign(ctx, param)
// 创建请求
5 months ago
client := gorequest.NewHttp()
2 years ago
// 设置参数
client.SetParams(params)
// 设置用户代理
client.SetUserAgent(gorequest.GetRandomUserAgentSystem())
// 发起请求
request, err := client.Get(ctx)
if err != nil {
return gorequest.Response{}, err
}
2 years ago
// 记录日志
5 months ago
if c.gormLog.status {
go c.gormLog.client.MiddlewareCustom(ctx, gostring.ToString(params.Get("method")), request)
2 years ago
}
return request, err
}