title: HttpClient.execute error =(
body: <p>And Error's are:</p>
  
  <blockquote>
    <p>error opening trace file:No Such file or directory(2);
    java.lang.IllegalStateException: Manager is shut down. at
    org.apache.http.impl.conn.SingleClientConnManager.assertStillUp(SingleClientConnManager.java:174)
    org.apache.http.impl.conn.SingleClientConnManager.getConnection(bla
    bla bla .java:212)
    org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(---.java:190)
    org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:326)
    org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
    org.apache.http.impl.client.AbstractHttpClient.xecute(AbstractHttpClient.java:487)
    org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)</p>
  </blockquote>
  
  <pre><code>and more...
  
  public class ReqClass {
      public static final String TAG = ReqClass.class.getSimpleName();
      //creating new ResClass object
      ResClass resp = new ResClass(); 
      //sending request
      HttpResponse response;
      //making the request - containst (url,header,entity);
      HttpPost request;
      //New HTTP Client
      HttpClient httpClient = new DefaultHttpClient();
  
      //our code in JSON or XML to Send Request
      private String s;
      //This variable contains the total number of keys
      private int size;
  
      // Map
      Map&lt;String,String&gt; code = new HashMap&lt;String, String&gt;();
  
      // Adding only Key Value parameters
      public void addparametr (String key, String value){                 
          code.put(key,value);
      }
  
      public String getS(){
          return s;
      }
  
      //Adding Key Value and size of new map.
      public void addparametr (String key, String value, int nOfValues){    
      }
  
      public void Build(String lang){
          //List Of keys
          List&lt;String&gt; keys=new ArrayList&lt;String&gt;(code.keySet());
          //k = keys; v = values;
          String k="",v="";
          // size = size of Map;
          size=code.size();
          // if we want to make our JSON Code to send Request
          if (lang=="json"){                                                 
              s="";
              s+="{";
              for (int i=0; i&lt;size; i++){
                  k=keys.get(i);
                  v=code.get(k);
                  if (i==size-1) s=s+'"'+k+'"'+": "+'"'+v+'"';
                  else s=s+'"'+k+'"'+": "+'"'+v+'"'+',';
              }
  
              s=s+"}";
          }
  
          if (lang =="xml"){                                                 
              s="";
              s+="&lt;code&gt;";
              for (int i=0; i&lt;size; i++){
                  k=keys.get(i);
                  v=code.get(k);
                  s=s+'&lt;'+k+'&gt;'+v+"&lt;/"+k+'&gt;';
              }
              s=s+"&lt;/code&gt;";
          }
      }
  
      // The Send Request Method - need link parameter and our JSON or XML code
      public ResClass SendR (String url, String lang){                         
          String valueOfSize = String.valueOf(size);
          request= new HttpPost(url);
          //adding a Header
          request.addHeader("Header - Request Size", valueOfSize);
          //adding request's body (Entity)
          HttpEntity entity;
          try {
              entity = new StringEntity(s, "UTF-8");
              request.setEntity(entity);
          } catch (UnsupportedEncodingException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }               
          BackGroundTask doItInBackGround = new BackGroundTask();
          doItInBackGround.execute();
  
          //closing our connection
          httpClient.getConnectionManager().shutdown();
          return resp;
      }
      private class BackGroundTask extends AsyncTask&lt;Void, Void, Void&gt;{
  
          @Override
          protected Void doInBackground(Void... params) {
              try {
                  //execute - means sending
                  response = httpClient.execute(request);
                  //adding new response to our Response Class
                  resp.addNewResponse(response);
              } catch (ClientProtocolException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              } catch (Exception e) {
                  Log.e(TAG, "Exception caught: ", e);
              }
              return null;
          }
      }
  }
  </code></pre>