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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to