|
|
|
@ -164,6 +164,9 @@ public class JmCommon {
|
|
|
|
|
" Credential=" + ak + "/" + credentialScope +
|
|
|
|
|
", SignedHeaders=" + signHeader +
|
|
|
|
|
", Signature=" + signature);
|
|
|
|
|
//加入超时时长
|
|
|
|
|
request.setReadTimeout(30000);
|
|
|
|
|
request.setConnectionTimeout(30000);
|
|
|
|
|
|
|
|
|
|
// 如果不是GET请求,设置请求体
|
|
|
|
|
if (!method.equals("GET") && body.length > 0) {
|
|
|
|
@ -173,10 +176,8 @@ public class JmCommon {
|
|
|
|
|
// 发送请求并获取响应
|
|
|
|
|
HttpResponse response = request.execute();
|
|
|
|
|
String responseBody = response.body();
|
|
|
|
|
|
|
|
|
|
// 关闭响应
|
|
|
|
|
response.close();
|
|
|
|
|
|
|
|
|
|
return responseBody;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|