commons-dev mailing list archives

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

I am using the HTTPClient() to get the content of a site
"http://www.expedia.com", 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
UrlGetMethod("http://www.expedia.com");

		hc.startSession(new URL("http://www.expedia.com"));

		hc.executeMethod(ugm);
}

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
HREF="http://expedia.msn.com/Default.asp?FromServerName=www.expedia.com">her
e</a>.</body>
"
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message