method bug

This commit is contained in:
bxd
2023-12-04 21:21:08 +08:00
parent 583b1fcfe5
commit d60862ad92
2 changed files with 5 additions and 1 deletions

View File

@@ -49,7 +49,8 @@ Requests is a fully featured HTTP client library for Golang. Network requests ca
* [DNS Settings](https://github.com/gospider007/requests/blob/master/test/dns_test.go)
* [Proxy](https://github.com/gospider007/requests/blob/master/test/proxy_test.go)
* [Well tested client library](https://github.com/gospider007/requests/tree/master/test)
* [Benchmark](https://github.com/gospider007/benchmark)
## [Benchmark](https://github.com/gospider007/benchmark)
[gospider007/requests](https://github.com/gospider007/requests) > [imroc/req](github.com/imroc/req) > [go-resty](github.com/go-resty/resty) > [wangluozhe/requests](github.com/wangluozhe/requests) > [curl_cffi](https://github.com/yifeikong/curl_cffi) > [httpx](https://github.com/encode/httpx) > [psf/requests](https://github.com/psf/requests)
## Supported Go Versions
Recommended to use `go1.21.3` and above.
Initially Requests started supporting `go modules`

View File

@@ -235,6 +235,9 @@ func (obj *Client) Request(ctx context.Context, method string, href string, opti
return
}
}
if optionBak.Method == "" {
optionBak.Method = method
}
for maxRetries := 0; maxRetries <= optionBak.MaxRetries; maxRetries++ {
option := optionBak
response, err = obj.request(ctx, &option)