How are you creating the URL? Try one of these methods:

path = URLEncoder.encode("finance.yahoo.com/q/hp?s=^DJI", "UTF-8");
uri = new URI("http://"; + path);

...or...

uri = new URI("http", "finance.yahoo.com", "/q/hp?s=^DJI", "");

On Feb 13, 11:55 pm, ivanchan <ivanm...@gmail.com> wrote:
> Hi all,
>
> I am trying to use HttpGet to fetch some data from yahoo finace, the
> whole url is
> "http://finance.yahoo.com/q/hp?s=^DJI";, from the log I gucess it
> complains
> about the '^' character, what is the right way to solve this problem?
> Thanks.
>
> E/AndroidRuntime(  287): java.lang.IllegalArgumentException: Illegal
> character i
> n query at index 32:http://finance.yahoo.com/q/hp?s=^DJI
> E/AndroidRuntime(  287):        at java.net.URI.create(URI.java:970)
> E/AndroidRuntime(  287):        at
> org.apache.http.client.methods.HttpGet.<init>
> (HttpGet.java:75)
> E/AndroidRuntime(  287):        at
> Ivan.stock.droid.HttpHelper.connect(HttpHelpe
>
> Regards,
> Ivan

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to