hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Terrell" <Steve.Terr...@guideworkstv.com>
Subject RE: error resolving hostname
Date Thu, 07 Jun 2007 19:06:48 GMT
I found the issue. Our hostname was using an underscore character. Valid
hostnames do not have underscores in them!:
http://en.wikipedia.org/wiki/Hostname (look for Restrictions on valid
host names)

   I still don't know why this worked with wget.

--Steve

-----Original Message-----
From: Roland Weber [mailto:ossfwot@dubioso.net] 
Sent: Thursday, June 07, 2007 2:54 PM
To: HttpClient User Discussion
Subject: Re: error resolving hostname

Hello Steve,

> If I use an IP address in my URL, everything works great. However, if
I use
> a hostname in place of the IP, the GetMethod request fails with a 404.
But,
> when I run the failing URL through wget, it works! I would have
expected
> wget to fail in the same manner as my HttpClient call. Why would wget
work
> and GetMethod fail?

404 is an error response from the server, which obviously doesn't
like something in the request. In HttpClient, you can enable wire
logging (for the headers) to see the exact request:
http://jakarta.apache.org/commons/httpclient/logging.html

Please compare the request being generated when you use the IP
address with the request when you use the hostname. Are you using
a plain hostname or a fully qualified one? Maybe you can also get
a trace of the request that wget sends? If you don't know how to
interpret the differences, please post traces of the requests to
this list. Then we'll take guesses :-)

hope that helps,
  Roland

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


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


Mime
View raw message