go-resty / resty

Simple HTTP and REST client library for Go
MIT License
9.89k stars 696 forks source link

parseResponseBody > Unmarshalc cannot unmarshal string into Go value of type map[string]interface {} #738

Closed codes0003 closed 10 months ago

codes0003 commented 10 months ago
resp, err := request.SetContext(cxt).Execute(method, url)
    if err != nil {
        return resp, err
    }
resp body :
"{\"code\":\"E002\",\"message\":\"参数不合法事件参数.endDate是必填项!\"}"

output : json: cannot unmarshal string into Go value of type map[string]interface {}

The problem stems from: parseResponseBody > Unmarshalc > : err = c.JSONUnmarshal(b, d)

please help me