Fail to send two parameters in http post request
<p>I trying to make http - post call. 
The server that i send him this request need to have two parameters<br>
   1. first parameter is Int
   2. second parameter is enum that i sending as string </p>

<p>I try to do it in two ways and them both fail:</p>

<p>First way:</p>

<pre><code> List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);  
 nameValuePairs.add(new BasicNameValuePair("intVal", "-100")); 
 nameValuePairs.add(new BasicNameValuePair("enumVal", "enumAsString"));  
 httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); 
</code></pre>

<p>I get 'bar request' as a response. </p>

<p>Second way: </p>

<pre><code>      DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(SERVER_ADDRESS + METHOD_NAME);
try
{
     HttpParams postParams = new BasicHttpParams();
           postParams.setIntParameter("intVal", -100 ); 
           postParams.setParameter   ("enumVal" , "enumAsString" ); 

           httppost.setParams(postParams);

           HttpResponse p = httpclient.execute(httppost);
      }
      catch(Exception e) 
      {

                  .... 

      }
</code></pre>

<p>In this way i see that the server get the parameters - but the first parameter ( that need to be int ) is 0 and the second parameter ( that need to be enum ) is 0 also. </p>

<p>P.S : The code that run on the server is WCF code - using REST.</p>

<p>Please .. i must solve this issue ... </p>

<p>Thanks. </p>
