****错误: 找不到符号
new StringBody(params.get(index).getValue(),
^
符号: 类 StringBody
```public String submit_Data(String uid, String picpath, String url) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("image", picpath));
params.add(new BasicNameValuePair("uid", uid));
HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpPost httpPost = new HttpPost(url);
try {
MultipartEntity entity = new MultipartEntity(
HttpMultipartMode.BROWSER_COMPATIBLE);
for (int index = 0; index < params.size(); index++) {
if (params.get(index).getName().equalsIgnoreCase("image")) {
System.out.println("post - if");
entity.addPart(params.get(index).getName(),
new FileBody(new File(params.get(index)
.getValue())));
} else {
entity.addPart(params.get(index).getName(),
new StringBody(params.get(index).getValue(),
Charset.forName("UTF-8")));
}
}
httpPost.setEntity(entity);
HttpResponse response = httpClient.execute(httpPost,
localContext);
responsecode = response.getStatusLine().getStatusCode();
if (responsecode == 200) {
HttpEntity resEntity = response.getEntity();
String Response = EntityUtils.toString(resEntity);
return Response;
}
} catch (Exception e) {
return "";
}
return "";
}
}