为什么RoundTrip不应该修改请求?
https://golang.org/src/net/http/client.go#L103
如果http.Request被RoundTripper (例如http.Transport)修改了,会发生什么?
发布于 2016-09-26 23:27:25
awnser在接口注释https://golang.org/src/net/http/client.go#L89中声明
A RoundTripper must be safe for concurrent use by multiple goroutines.如果服务器收到一个请求,并启动了多个goroutines,则必须确保所有请求都在相同的输入上工作。如果RoundTripper更改了请求,它可能会使已经收集的数据变得无用(这可能甚至不会被注意到)
https://stackoverflow.com/questions/39314219
复制相似问题