丽知:修改:中台转发http
This commit is contained in:
parent
a7a30efd9e
commit
46add53677
|
@ -56,6 +56,13 @@ public class PushU8CByApiCode {
|
||||||
httpPost.setHeader("apicode", apicode);
|
httpPost.setHeader("apicode", apicode);
|
||||||
//data
|
//data
|
||||||
httpPost.setEntity(new StringEntity(data, "UTF-8"));
|
httpPost.setEntity(new StringEntity(data, "UTF-8"));
|
||||||
|
// 配置请求的超时设置
|
||||||
|
RequestConfig requestConfig = RequestConfig.custom()
|
||||||
|
.setConnectTimeout(600000) // 连接超时时间: 600秒
|
||||||
|
.setConnectionRequestTimeout(600000) // 请求超时时间: 600秒
|
||||||
|
.setSocketTimeout(600000) // 数据读取超时时间: 600秒
|
||||||
|
.build();
|
||||||
|
httpPost.setConfig(requestConfig);
|
||||||
CloseableHttpResponse response = httpclient.execute(httpPost);
|
CloseableHttpResponse response = httpclient.execute(httpPost);
|
||||||
|
|
||||||
HttpEntity entity = response.getEntity();
|
HttpEntity entity = response.getEntity();
|
||||||
|
@ -96,6 +103,14 @@ public class PushU8CByApiCode {
|
||||||
httpPost.setHeader("apicode", apicode);
|
httpPost.setHeader("apicode", apicode);
|
||||||
//data
|
//data
|
||||||
httpPost.setEntity(new StringEntity(data, "UTF-8"));
|
httpPost.setEntity(new StringEntity(data, "UTF-8"));
|
||||||
|
|
||||||
|
// 配置请求的超时设置
|
||||||
|
RequestConfig requestConfig = RequestConfig.custom()
|
||||||
|
.setConnectTimeout(600000) // 连接超时时间: 600秒
|
||||||
|
.setConnectionRequestTimeout(600000) // 请求超时时间: 600秒
|
||||||
|
.setSocketTimeout(600000) // 数据读取超时时间: 600秒
|
||||||
|
.build();
|
||||||
|
httpPost.setConfig(requestConfig);
|
||||||
CloseableHttpResponse response = httpclient.execute(httpPost);
|
CloseableHttpResponse response = httpclient.execute(httpPost);
|
||||||
HttpEntity entity = response.getEntity();
|
HttpEntity entity = response.getEntity();
|
||||||
String result = EntityUtils.toString(entity);
|
String result = EntityUtils.toString(entity);
|
||||||
|
|
Loading…
Reference in New Issue