Browse Source

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

csx 3 years ago
parent
commit
9f7597b5ff
2 changed files with 2 additions and 3 deletions
  1. 1 1
      service/jsyb_service.go
  2. 1 2
      utils/csbhttp/httpcaller.go

+ 1 - 1
service/jsyb_service.go View File

@@ -80,7 +80,7 @@ func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte
80 80
 	csbHP.AddHeader("_api_version", "1.0.0")
81 81
 	csbHP.AddHeader("_api_access_key", ak)
82 82
 	csbHP.AddHeader("_api_signature", hmacsha1(key, sk))
83
-	csbHP.AddHeader("Content-Type", "application/json")
83
+	csbHP.AddHeader("Content-Type", "application/json;charset=UTF-8")
84 84
 
85 85
 	//request.Header.Set("Content-Type", "application/json;charset=UTF-8")
86 86
 

+ 1 - 2
utils/csbhttp/httpcaller.go View File

@@ -212,7 +212,6 @@ func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcEr
212 212
 	}
213 213
 
214 214
 	reqUrl := params.requestUrl
215
-
216 215
 	defaultContentType := "application/x-www-form-urlencoded"
217 216
 	if params.ct.jsonBody != "" {
218 217
 		_, err = json.Marshal(params.ct.jsonBody)
@@ -231,7 +230,7 @@ func Invoke(params HttpParams) (str string, rtnHeaders map[string][]string, hcEr
231 230
 	}
232 231
 
233 232
 	req, err := http.NewRequest(method, reqUrl, bytes.NewBufferString(reqStr))
234
-
233
+	req.Close = true
235 234
 	if err != nil {
236 235
 		return str, rtnHeaders, &HttpCallerException{Message: "failed to construct http post request", CauseErr: err}
237 236
 	}