|
@@ -8,7 +8,7 @@ import java.io.OutputStream;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.MalformedURLException;
|
|
|
import java.net.URL;
|
|
|
-
|
|
|
+import nc.log.NcLog;
|
|
|
|
|
|
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
|
|
//import net.sf.json.JSONObject;
|
|
@@ -48,9 +48,9 @@ public class HttpHelper {
|
|
|
//设置请求方法
|
|
|
connection.setRequestMethod("POST");
|
|
|
//设置连接超时时间
|
|
|
- connection.setConnectTimeout(30000);
|
|
|
+ connection.setConnectTimeout(60000);
|
|
|
//设置读取超时时间
|
|
|
- connection.setReadTimeout(30000);
|
|
|
+ connection.setReadTimeout(60000);
|
|
|
//DoOutput设置是否向httpUrlConnection输出,DoInput设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个
|
|
|
//设置是否可读取
|
|
|
connection.setDoOutput(true);
|
|
@@ -87,8 +87,10 @@ public class HttpHelper {
|
|
|
}
|
|
|
|
|
|
} catch (MalformedURLException e) {
|
|
|
+ NcLog.info(e.getMessage());
|
|
|
ExceptionUtils.wrappBusinessException(e.getMessage());
|
|
|
} catch (IOException e) {
|
|
|
+ NcLog.info(e.getMessage());
|
|
|
ExceptionUtils.wrappBusinessException(e.getMessage());
|
|
|
} finally {
|
|
|
//关闭连接
|
|
@@ -96,6 +98,7 @@ public class HttpHelper {
|
|
|
try {
|
|
|
br.close();
|
|
|
} catch (IOException e) {
|
|
|
+ NcLog.info(e.getMessage());
|
|
|
ExceptionUtils.wrappBusinessException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
@@ -103,6 +106,7 @@ public class HttpHelper {
|
|
|
try {
|
|
|
os.close();
|
|
|
} catch (IOException e) {
|
|
|
+ NcLog.info(e.getMessage());
|
|
|
ExceptionUtils.wrappBusinessException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
@@ -110,6 +114,7 @@ public class HttpHelper {
|
|
|
try {
|
|
|
is.close();
|
|
|
} catch (IOException e) {
|
|
|
+ NcLog.info(e.getMessage());
|
|
|
ExceptionUtils.wrappBusinessException(e.getMessage());
|
|
|
}
|
|
|
}
|