roc

Results 89 comments of roc

`SetHeaderNonCanonical` 仅对 `http/1.1` 生效,因为只有 `http/1.1` 才可以控制大小写,http2和http3都是只能小写。 ```txt // SetHeaderNonCanonical set a header for the request which key is a // non-canonical key (keep case unchanged), only valid for HTTP/1.1. ```...

> @imroc 请问,是否有好的方式修正这个错误?? 可以用 client.SetCommonRetryCount(n) 自动重试下。如果相同参数下,标准库没这个问题的话,得深入研究下了,欢迎大家来帮忙定位贡献下

> 问题出现在client设置User-agent上。 正在处理请求的过程中设置 User-Agent? 这种应该可能有问题,一般都在用client前先设置好User-Agent,req本身没有加锁,默认加锁影响性能,如果实在要这么用(请求过程中改client User-Agent),可以自己在外围加锁控制下

Proxy is a client-level only setting, but you can use some hook (e.g. OnBeforeRequest) to change proxy for each request. The exampoe here may inspire you: https://req.cool/docs/examples/easily-write-crawlers-with-req/#automatically-change-ip-when-request-fails-set-proxy

可以用 client 中间件,OnAfterResponse 里判断下,如果 status 不是 SuccessState,统一都抛成 error。参考 : https://req.cool/zh/docs/examples/handle-exceptions-with-middleware/

I don't think it's possible, `SetFileReader` and `SetFiles` will not load the hole file in memory, just copy from reader to server, I'll check it out in a few days...

想问下用在什么场景?这个协议比较旧且有安全问题不被推荐

已加到TODO,后续支持