Commit 0c3ce853 authored by yanzg's avatar yanzg

修复bug

parent 2299e56e
......@@ -22,11 +22,11 @@ public class HttpHelper {
/**
* 链接超时
*/
public static int HTTP_CONNECT_TIMEOUT = 10 * 1000;
public static int HTTP_CONNECT_TIMEOUT = 3 * 1000;
/**
* 读取超时
*/
public static int HTTP_READ_TIMEOUT = 30 * 1000;
public static int HTTP_READ_TIMEOUT = 15 * 1000;
/**
* 字符编码
*/
......@@ -46,7 +46,7 @@ public class HttpHelper {
* 获取请求参数
*
* @param obj 对象
* @return
* @return 请求参数字符串
*/
public static String getUrlParameter(Object obj, String charset) {
MapRow to = JsonHelper.to(obj, MapRow.class);
......@@ -66,8 +66,8 @@ public class HttpHelper {
* 获取连接
*
* @param url 请求地址
* @return
* @throws IOException
* @return 链接
* @throws IOException 抛出的异常信息
*/
public static HttpURLConnection getConn(String url) throws IOException {
return getConn(url, null, false);
......@@ -78,8 +78,8 @@ public class HttpHelper {
*
* @param url 请求地址
* @param header 请求头
* @return
* @throws IOException
* @return 链接
* @throws IOException 抛出的异常信息
*/
public static HttpURLConnection getConn(String url, Map<String, String> header) throws IOException {
return getConn(url, header, false);
......@@ -90,8 +90,8 @@ public class HttpHelper {
*
* @param url 请求地址
* @param isApplicationJson 是否请求json
* @return
* @throws IOException
* @return 链接
* @throws IOException 抛出的异常信息
*/
public static HttpURLConnection getConn(String url, boolean isApplicationJson) throws IOException {
return getConn(url, null, isApplicationJson);
......@@ -103,8 +103,8 @@ public class HttpHelper {
* @param url 请求地址
* @param header 请求头
* @param isApplicationJson 是否请求json
* @return
* @throws IOException
* @return 链接
* @throws IOException 抛出的异常信息
*/
public static HttpURLConnection getConn(String url, Map<String, String> header, boolean isApplicationJson) throws IOException {
// 创建URL对象
......@@ -289,10 +289,11 @@ public class HttpHelper {
/**
* 读取数据流
*
* @param stream
* @param result
* @return
* @throws IOException
* @param stream 流
* @param result 结果字符串
* @param charset 编码方式
* @return 读取的缓存流
* @throws IOException IO异常
*/
private static BufferedReader readStream(InputStream stream, StringBuilder result, String charset) throws IOException {
if (stream == null) {
......
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