HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(
"http://xxxxxxx/geo/getlocation.php");
MultipartEntity reqEntity = new MultipartEntity(
HttpMultipartMode.BROWSER_COMPATIBLE);
reqEntity.addPart("longtiude", new StringBody(mylong));
reqEntity.addPart("latitude", new StringBody(mylat));
reqEntity.addPart("newtimeString", new StringBody(time));
reqEntity.addPart("dateString", new StringBody(date));
reqEntity.addPart("locationName", new StringBody(address));
httppost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httppost);
String responseBody = EntityUtils
.toString(response.getEntity());
Log.e("response", responseBody);
我正在使用 httpclient 使用上面的代码在服务器上发布。但我得到了这样的回应
Your post request is not being received quickly enough please retry
我已正确添加权限和 jar 文件,也尝试使用 basicnamevaluepair 但响应相同。httpclient 已弃用,但它应该知道...
我不知道原因。我做错了什么。任何帮助请...