- use Request.Body directly when handling jd msg.

This commit is contained in:
gazebo
2018-06-27 15:42:44 +08:00
parent e96e04ae0e
commit c00d00630e
3 changed files with 13 additions and 27 deletions

View File

@@ -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 {