一些优化
This commit is contained in:
@@ -182,7 +182,9 @@ func (c *Curlx) SendWithResponee(ctx context.Context, ps ...Param) Response {
|
||||
if n == 0 {
|
||||
break
|
||||
}
|
||||
body = append(body, buf...)
|
||||
// 读取n个字节
|
||||
body = append(body, buf[:n]...)
|
||||
// body = append(body, buf...)
|
||||
}
|
||||
default:
|
||||
body, _ = io.ReadAll(resp.Body)
|
||||
|
||||
@@ -106,6 +106,15 @@ func SetUserAgent(userAgent UserAgent) Param {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置Referer
|
||||
*/
|
||||
func SetReferer(referer string) Param {
|
||||
return func(param *ClientParams) {
|
||||
param.Headers["Referer"] = referer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cookies
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user