req
req copied to clipboard
Simple Go HTTP client with Black Magic
Hi, i got such debug messages in my log: 2022/10/17 23:29:41.891031 DEBUG [req] cannot determine the unmarshal function with "text/plain;charset=UTF-8" Content-Type, default to json There is no way to set...
resp.Dump() 获取到的是请求包+响应包。这个只能自己根据strings.inde去分割数据,然后获取到请求包、响应包?
panic: runtime error: slice bounds out of range [:333] with capacity 299 goroutine 4361379 [running]: bytes.(*Buffer).grow(0xc1acae3b00, 0xf) /var/jenkins_home/go/go1.17.9/src/bytes/buffer.go:148 +0x226 bytes.(*Buffer).Write(0xc1acae3b00, {0xc1acce4c90, 0xf, 0xc10482a9d0}) /var/jenkins_home/go/go1.17.9/src/bytes/buffer.go:172 +0x66 github.com/imroc/req/v3/internal/dump.(*Dumper).Dump(0xc1acb608e8, {0xc1acce4c90, 0xf, 0x10}) /root/go/pkg/mod/github.com/imroc/req/[email protected]/internal/dump/dump.go:138...
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xe pc=0x47410b] goroutine 168733876 [running]: bytes.(*Buffer).Write(0xc1ac22f470, {0xc1ac064780, 0x26, 0xc1d5dd67c8}) /var/jenkins_home/go/go1.17.9/src/bytes/buffer.go:174 +0xb5 github.com/imroc/req/v3/internal/dump.(*Dumper).Dump(0xc1abc59f38, {0xc1ac064780, 0x26, 0x30})...
有些请求,query参数的顺序不能打乱,比如某音的。 如何禁止query参数自动排序?
See discussions: https://github.com/imroc/req/discussions/168
Using `ImpersonateFirefox` instead works fine ```go package main import ( "fmt" "log" "github.com/imroc/req/v3" ) func main(){ client := req.C().ImpersonateChrome() resp, err := client.R().Get("https://tuta.com/") if err != nil { log.Fatal(err) }...
` response, err := req.C().EnableForceHTTP2(). SetTLSFingerprintChrome(). SetProxyURL(requestInfo.Proxy).R().........` 这样是没有问题的,但是当我使用SetTLSFingerprintRandomized() 或者 SetTLSFingerprintAndroid()都会报错: http2: unexpected ALPN protocol ""; want "h2" panic: runtime error: invalid memory address or nil pointer dereference。 其他类型的指纹也可能有类似的问题