- use Request.Body directly when handling jd msg.
This commit is contained in:
@@ -181,13 +181,8 @@ func HTTPResponse2Json(response *http.Response) (map[string]interface{}, error)
|
||||
return jsonResult, nil
|
||||
}
|
||||
|
||||
func HTTPRequest2Values(request *http.Request, needDecode bool) (url.Values, error) {
|
||||
bodyData, err := ioutil.ReadAll(request.Body)
|
||||
if err != nil {
|
||||
baseapi.SugarLogger.Errorf("ioutil.ReadAll error:%v", err)
|
||||
return nil, err
|
||||
}
|
||||
bodyStr := string(bodyData)
|
||||
func HTTPBody2Values(data []byte, needDecode bool) (url.Values, error) {
|
||||
bodyStr := string(data)
|
||||
if needDecode {
|
||||
bodyStr1, err := url.QueryUnescape(bodyStr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user