如何设置 HTTP 多部分文件发布超时。我想在互联网连接不存在时将图像上传到服务器如何处理这种情况?
最后,我找到了解决方案,这是设置HTTPClient超时的代码
HttpParams httpParameters = new BasicHttpParams();
int timeout连接 = 30000;HttpConnectionParams.setConnectionTimeout(httpParameters,timeoutConnection);
int timeoutSocket = 30000;
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
HttpClient httpClient = new DefaultHttpClient(httpParameters);