Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
6b2a39e16f
1 changed files with 12 additions and 0 deletions
  1. 12 0
      utils/csbhttp/httpcaller.go

+ 12 - 0
utils/csbhttp/httpcaller.go View File

@@ -213,6 +213,11 @@ func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcEr
213 213
 
214 214
 	reqUrl := params.requestUrl
215 215
 	defaultContentType := "application/x-www-form-urlencoded"
216
+	fmt.Println("打印开始")
217
+	fmt.Println(params.ct.jsonBody)
218
+	fmt.Println(reqUrl)
219
+	fmt.Println(params)
220
+
216 221
 	if params.ct.jsonBody != "" {
217 222
 		_, err = json.Marshal(params.ct.jsonBody)
218 223
 		if err == nil {
@@ -229,8 +234,14 @@ func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcEr
229 234
 		reqStr = data.Encode()
230 235
 	}
231 236
 
237
+	fmt.Println("打印开始1")
238
+	fmt.Println(reqStr)
239
+
232 240
 	req, err := http.NewRequest(method, reqUrl, bytes.NewBufferString(reqStr))
233 241
 
242
+	fmt.Println("打印开始2")
243
+	fmt.Println(req)
244
+
234 245
 	if err != nil {
235 246
 		return str, rtnHeaders, &HttpCallerException{Message: "failed to construct http post request", CauseErr: err}
236 247
 	}
@@ -264,6 +275,7 @@ func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcEr
264 275
 	resp, err := client.Do(req)
265 276
 
266 277
 	if err != nil {
278
+		fmt.Println(err)
267 279
 		return str, rtnHeaders, &HttpCallerException{Message: "failed to invoke http post", CauseErr: err}
268 280
 	}
269 281