From d9f60d135f91acd14720acbdd38f6c6d3ccc0ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Mon, 5 Sep 2022 09:21:00 +0800 Subject: [PATCH] - add request UserAgent --- const.go | 2 +- request.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/const.go b/const.go index 109b96e..e050270 100644 --- a/const.go +++ b/const.go @@ -17,4 +17,4 @@ const ( logTable = "kashangwl" ) -const Version = "1.0.15" +const Version = "1.0.16" diff --git a/request.go b/request.go index 8a7cbc0..9e8f3c4 100644 --- a/request.go +++ b/request.go @@ -24,6 +24,9 @@ func (c *Client) request(ctx context.Context, url string, params map[string]inte // 设置格式 client.SetContentTypeJson() + // 设置用户代理 + client.SetUserAgent(gorequest.GetRandomUserAgentSystem()) + // 设置参数 client.SetParams(params)