commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: using ^ in url HttpClient fails
Date Tue, 12 Jun 2007 10:20:18 GMT
On 12/06/07, Jason Novotny <novotny@gridsphere.org> wrote:
>
> If I have a URL with a ^ in it I get a failure:
>
>  [java]
> http://download.finance.yahoo.com/d/quotes.csv?s=^DJA&f=sl1d1t1c1ohgv&e=.csv
>     [java] Exception in thread "main"
> java.lang.IllegalArgumentException: Invalid uri

The character "^" is not valid in a URI

> 'http://ichart.finance.yahoo.com/table.csv?s=^TIE&a=&b=&c=&d=&e=&f=&g=&ignore=.csv':
> Invalid query
>     [java]     at
> org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222)
>     [java]     at
> org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:89)
>
>
> But the link normally works fine if I type in my browser... do I need to

Because the browser escapes it.

> do anything special to escape it?

You can hexify it as %5E.

> Thanks, Jason
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message