您可以使用来自Apache Commons的Http Client。例如:
private class PostTask extends AsyncTask<String, String, String> { @Override protected String doInBackground(String... data) { // Create a new HttpClient and Post Header HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://<ip address>:3000"); try { //add data List<NamevaluePair> namevaluePairs = new ArrayList<NamevaluePair>(1); namevaluePairs.add(new BasicNamevaluePair("data", data[0])); httppost.setEntity(new UrlEnpredFormEntity(namevaluePairs)); //execute http post HttpResponse response = httpclient.execute(httppost); } catch (ClientProtocolException e) { } catch (IOException e) { } }}更新
您可以使用Volley
Android网络库发布数据。正式文件在这里。
我个人将Android Asynchronous Http Client用于少数REST Client项目。
值得探索的其他工具是Retrofit。



