hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Davies" <juliusdav...@gmail.com>
Subject Re: invalid usi again with special character "^"
Date Thu, 26 Oct 2006 13:57:42 GMT
Try URL-Encoding that character.  You just use "%" + "hex value of character
in ascii table".  For example, the space character becomes "%20".  In your
case I think you want to use "%5E" instead of "^".

http://en.wikipedia.org/wiki/Percent-encoding

yours,

Julius Davies

http://juliusdavies.ca/


On 10/23/06, Zhe Sun <Zhe.Sun@obs-gyn.ox.ac.uk> wrote:
>
> Hi all,
>
> I trying to use the httpclient to retrieve some stock quote output, but
> it seems that the URI does not like the character "^". Not sure how to
> tackle it. Any help would be appreciated.
>
> .....
>        StringBuffer url = new
> StringBuffer("http://quote.yahoo.com/download/javasoft.beans?symbols=");
>         url = url.append("^IXIC");
>         url.append("&format=sl1d1t1c1ohgvbap");
> .....
>
> The runtime error was,
>
> Invalid uri
> 'http://quote.yahoo.com/download/javasoft.beans?symbols=^IXIC&format
> =sl1d1t1c1ohgvbap': Invalid query:
> java.lang.IllegalArgumentException: Invalid uri
> 'http://quote.yahoo.com/download
> /javasoft.beans?symbols=^IXIC&format=sl1d1t1c1ohgvbap': Invalid query
>         at org.apache.commons.httpclient.HttpMethodBase.<init>(Unknown
> Source)
>         at
> org.apache.commons.httpclient.methods.GetMethod.<init>(Unknown Source
> )
>
> Thanks,
>
> Zhe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message