title: Android: how to do HttpPost with a certificate
body: <p>I have an Application that performs an HttpPost.</p>
  
  <p>Now I need to add a Certificate to the post to be accepted by the server receiving the HttpPost.</p>
  
  <p><strong>Please how do I go about it?</strong></p>
  
  <p><strong>Any suggestion very much appreciated !!!</strong></p>
  
  <pre><code>HttpClient httpclient = new DefaultHttpClient();
  
      HttpPost httppost = new HttpPost("https://svcs.sandbox.paypal.com/AdaptivePayments/Preapproval");
      try {
  
          httppost.addHeader("X-PAYPAL-SECURITY-USERID", "maurizio.pietrantuono_api1.db.com");
          httppost.addHeader("X-PAYPAL-SECURITY-PASSWORD", "1395657583");
          httppost.addHeader("X-PAYPAL-SECURITY-SIGNATURE", "A0GgTivJ6ivBB8QDTl.cZfiYK5d9AZwsFixwIUdUhJc4JXTriwpfU2zw");
          httppost.addHeader("X-PAYPAL-REQUEST-DATA-FORMAT", "NV");
          httppost.addHeader("X-PAYPAL-RESPONSE-DATA-FORMAT", "NV");
          httppost.addHeader("X-PAYPAL-APPLICATION-ID", "APP-80W284485P519543T");
  
          StringEntity se=new StringEntity("cancelUrl=http://your_cancel_url"+
  "&amp;currencyCode=USD"+
  "&amp;endingDate=2015-03-29T08%3A00%3A00.000Z"+
  "&amp;maxAmountPerPayment=200.00"+
  "&amp;maxNumberOfPayments=30"+
  "&amp;maxTotalAmountOfAllPayments=1500.00"+
  "&amp;pinType=NOT_REQUIRED"+
  "&amp;requestEnvelope.errorLanguage=en_US"+
  "&amp;returnUrl=http://www.google.com"+
  "&amp;startingDate=2014-04-29T07%3A00%3A00.000Z"+
  "&amp;senderEmail=mauriziop-facilitator@hotmail.it");
          httppost.setEntity(se);
  
          HttpResponse response = httpclient.execute(httppost);
  </code></pre>