Browse Source

test: 共享报告回调

hsun 5 months ago
parent
commit
e839db4395
1 changed files with 4 additions and 4 deletions
  1. 4 4
      services/report_outer.go

+ 4 - 4
services/report_outer.go

@@ -72,7 +72,7 @@ func OuterReportCallBack(outReportId int, title, fileUrl, fileType string) (err
 	requestUrl = conf.ConfVal + OuterReportCallBackApiUrl
 
 	// 请求接口
-	resByte, e := OuterReportCallBackPost(requestUrl, params, "application/json")
+	resByte, e := OuterReportCallBackPut(requestUrl, params, "application/json;charset=utf-8")
 	if e != nil {
 		err = fmt.Errorf("接口请求失败, %v", e)
 		return
@@ -89,11 +89,11 @@ func OuterReportCallBack(outReportId int, title, fileUrl, fileType string) (err
 	return
 }
 
-// OuterReportCallBackPost 外部报告回调POST
-func OuterReportCallBackPost(url, postData string, params ...string) ([]byte, error) {
+// OuterReportCallBackPut 外部报告回调POST
+func OuterReportCallBackPut(url, postData string, params ...string) ([]byte, error) {
 	body := ioutil.NopCloser(strings.NewReader(postData))
 	client := &http.Client{}
-	req, e := http.NewRequest("POST", url, body)
+	req, e := http.NewRequest("PUT", url, body)
 	if e != nil {
 		return nil, fmt.Errorf("http request err: %v", e)
 	}