commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Cheung <>
Subject Redirect problems in HTTP client of Jakarta Commons
Date Sun, 28 Apr 2002 02:56:13 GMT

I am using the HTTPClient() to get the content of a site
"", but I got the following exception saying
redirecting to a different host is not implemented. But when I use the URL
class in jdk, i am able to get the content of the site. Is it collect to say
HTTP client is build on top of the URL class in JDK, if yes, if I can access
site using the URL class, why I can't access site using HttpClient? Or Did I
do something in my problem below?

Thanks for any suggestion.

My program:

public static void main(String[] args) throws Exception {

		HttpClient hc = new HttpClient();
		UrlGetMethod ugm =  new

		hc.startSession(new URL(""));


The log file:
2002-04-27 21:50:16,296 [main] INFO  httpclient.wire - <<
"<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a
2002-04-27 21:50:16,306 [main] INFO
org.apache.commons.httpclient.HttpMethod - Server is attempting to redirect
a different host, which is currently not supported. Returning 302.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message