private static DefaultHttpClient = new DefaultHttpClient();
public String post(String uri,String params) throws URISyntaxException, ClientProtocolException, IOException{
System.out.println(uri);
HttpPost httpPost = new HttpPost();
httpPost.setURI(new URI(uri));
httpPost.setEntity(new StringEntity(params, "UTF-8"));
HttpResponse response2 = this.getCLient().execute(httpPost);
HttpEntity entity = response2.getEntity();
String data = this.getData(entity.getContent());
EntityUtils.consume(entity);
return data;
}
public String getData(InputStream in) throws IOException {
String dd = "";
int length = 0;
byte[] data = new byte[1024];
while ((length = in.read(data)) != -1) {
dd += new String(data, 0, length);
}
return dd;
}