Open 0xObjc opened 2 months ago
那是因为HTTPS自动嗅探服务端所支持的协议(http1/2/3),选择到了http2,而http2和http3都固定只能是小写,没有大写一说。只有http1才有大小写。如果需要,你可以强制使用http1:
c := req.C().EnableDumpAll().SetBaseURL("https://httpbin.org").EnableForceHTTP1()
参考注释说明:
// SetHeadersNonCanonical set headers from a map for the request which key is a
// non-canonical key (keep case unchanged), only valid for HTTP/1.1.
func (r *Request) SetHeadersNonCanonical(hdrs map[string]string) *Request {