req icon indicating copy to clipboard operation
req copied to clipboard

OnBeforeRequest 无法获取request的Body

Open Ybzjzfr opened this issue 1 year ago • 1 comments

r:=req.C().DevMode()
r.OnBeforeRequest(func(client *req.Client, request *req.Request) error {
    if request.Method == "POST" {
        fmt.Printf("%+v", request)
    }
}
postBody:="123"
r.R().SetResult(&resp).SetBody(&postBody).Post("xxxxxx")

输出的信息里面没有postBody的内容 RawURL:xxxxxx Method:POST Body:[] GetBody: URL:

Ybzjzfr avatar Sep 26 '23 09:09 Ybzjzfr