Sunday, 15 September 2013

How to send a sentence having space as an argument in Httpget in android -


I have a Httpget request that sends a person's address to the server to access the server After that I will receive a confirmation message such as success I have given a toast message to print the received string. I am receiving toast messages, while I am writing a line without space. But the problem is that, when I am giving a sentence including space, it is falsely closing the emulator.

The error is shown in logcat as follows:

  06-21 15: 01: 10.083: E / Android Time (513): Java.lang.IllegalArgumentException: Invalid character in query on index 53: http://r4m.co/android/api.php   

You escaped your request parameter Can:

  import java.net.URLEncoder; URLEncoder.encode (string, charsetname);    

No comments:

Post a Comment