public void saveDni(String id, String dni) {     

HttpClient httpclient = new DefaultHttpClient();     
HttpPost httppost = new HttpPost("");      

try {         
    //Añade las variables a enviar por post         
    List<NameValuePair> postValues = new ArrayList<NameValuePair>(2);         
    postValues.add(new BasicNameValuePair("id", "000001"));         
    postValues.add(new BasicNameValuePair("dni", "23234345T"));         

    httppost.setEntity(new UrlEncodedFormEntity(postValues));          

    //Hace la petición         
    HttpResponse response = httpclient.execute(httppost);              
catch (ClientProtocolException e) {         
    //TODO Auto-generated catch block     
catch (IOException e) {         
    //TODO Auto-generated catch block     
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.