http post method problem
<p>In my application I'm using outpost method to send data to web service which is in .net.Now when i send string with spaces or special characters it takes the string with e.g. test string would display like test+string.</p>

<p>I'm using httpDefaultClient with nameValuePair to send data...i've used UrlEncode function to encode my string but still result is the same...
Please help me...</p>

<p>Here is my code</p>

<pre><code>//web service call
                HttpClient client=new DefaultHttpClient();
                HttpPost request = new HttpPost();
                request.setURI(new URI(url2));

                List&lt;NameValuePair&gt; nameValuePairs=new ArrayList&lt;NameValuePair&gt;();
                //  nameValuePairs.add(new BasicNameValuePair("CreateHotSpots", value))
                nameValuePairs.add(new BasicNameValuePair("sKey",""+globalClass.getUser_key()));
                nameValuePairs.add(new BasicNameValuePair("sLAKE",encodedlakename));
                if(!(DragAndDropPinActivity.point.isEmpty())){
                    nameValuePairs.add(new BasicNameValuePair("sLAT",""+DragAndDropPinActivity.point.get(0)));
                    nameValuePairs.add(new BasicNameValuePair("sLon",""+DragAndDropPinActivity.point.get(1)));

                }
                else
                {
                    url2=url2.concat("&amp;sLAT="+""+myLatitude);
                    url2=url2.concat("&amp;sLon="+""+myLongitude);

                }

                nameValuePairs.add(new BasicNameValuePair("sDesc",encodedDesc));
                nameValuePairs.add(new BasicNameValuePair("sSpeciesofFish",encodedFishSpecies));
                nameValuePairs.add(new BasicNameValuePair("sBaitUsed",encodedbUsed));
                nameValuePairs.add(new BasicNameValuePair("sWeatherInformation",encodedwInfo));
                nameValuePairs.add(new BasicNameValuePair("season",encodedlseason));
                nameValuePairs.add(new BasicNameValuePair("sDesc",""+encodedDesc));
                if(share)
                {
                    nameValuePairs.add(new BasicNameValuePair("sShareInfo","true"));
                }
                else
                {
                    nameValuePairs.add(new BasicNameValuePair("sShareInfo","false"));
                }

                Log.e("name value pairs",""+nameValuePairs.toString());
                UrlEncodedFormEntity entity_st=new UrlEncodedFormEntity(nameValuePairs,"UTF-8");
                request.setEntity(entity_st);

                HttpResponse response = client.execute(request);
                HttpEntity resEntity = response.getEntity();  
                if (resEntity != null) { 

                    Responce=EntityUtils.toString(resEntity);
                    Log.i("responce ======",""+Responce);

                }

            }
            catch (Exception e) {
                e.printStackTrace();
                String message=e.getMessage();
                Log.e("meaasge with erroe",message);
            }

            return Responce;
        }
</code></pre>
