1
This commit is contained in:
@@ -141,13 +141,8 @@ const (
|
||||
|
||||
// HttpToGuoYuanFN 订单消息推送果园
|
||||
func HttpToGuoYuanFN(param map[string]interface{}, requestType string, serverType string) (*http.Response, error) {
|
||||
//var paramData []byte
|
||||
//var err error
|
||||
//paramData, err = json.Marshal(param)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
//body := strings.NewReader(string(paramData))
|
||||
//cl := http.Client{}
|
||||
|
||||
url := ""
|
||||
if serverType == "prod" {
|
||||
switch requestType {
|
||||
@@ -175,15 +170,18 @@ func HttpToGuoYuanFN(param map[string]interface{}, requestType string, serverTyp
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
httpReq, err := http.NewRequest(http.MethodPost, url, strings.NewReader(utils.Map2URLValues(param).Encode()))
|
||||
byteParam, _ := json.Marshal(param)
|
||||
httpReq, err := http.NewRequest(http.MethodPost, url, strings.NewReader(string(byteParam)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
httpReq.Header.Set("Content-Type", "application/json")
|
||||
httpReq.Header.Set("accept", "application/json, text/plain, */*")
|
||||
httpReq.Header.Add("content-type", "application/json")
|
||||
|
||||
httpRes, err := http.DefaultClient.Do(httpReq)
|
||||
defer httpRes.Body.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return httpRes, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user