Commit 60b977c0 authored by yanzg's avatar yanzg

导出Excel边框

parent 55d4990e
......@@ -427,10 +427,11 @@ public class HttpHelper {
/**
* post请求form-data
* @param url
* @param parametersBody
* @return
* @throws Exception
*
* @param url 请求地址
* @param parametersBody 参数值
* @return 返回值
* @throws Exception 异常
*/
public static String postRequest(String url, List<NameValuePair> parametersBody) throws Exception {
HttpEntity entity = new UrlEncodedFormEntity(parametersBody, Charsets.UTF_8);
......@@ -443,11 +444,11 @@ public class HttpHelper {
post.addHeader("Accept", "application/json");
post.setEntity(entity);
RequestConfig config = RequestConfig.custom()
.setConnectionRequestTimeout(1000)
//服务端相应超时
.setSocketTimeout(1000)
.setConnectionRequestTimeout(HTTP_CONNECT_TIMEOUT)
//建立socket链接超时
.setConnectTimeout(3000)
.setConnectTimeout(HTTP_CONNECT_TIMEOUT)
//服务端相应超时
.setSocketTimeout(HTTP_READ_TIMEOUT)
.build();
post.setConfig(config);
String var8;
......@@ -455,12 +456,11 @@ public class HttpHelper {
HttpClient client = HttpClientBuilder.create().build();
HttpResponse response = client.execute(post);
int code = response.getStatusLine().getStatusCode();
String result = EntityUtils.toString(response.getEntity());
if (code >= 400) {
throw new Exception(EntityUtils.toString(response.getEntity()));
throw new HttpCodeException(String.valueOf(code), result);
}
var8 = EntityUtils.toString(response.getEntity());
} catch (Exception var11) {
throw new Exception("postRequest -- Client protocol exception!", var11);
var8 = result;
} finally {
post.releaseConnection();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment