[Zope] HTTP status code 302
Steve Spicklemire
steve@spvi.com
Sun, 10 Dec 2000 08:54:19 -0500 (EST)
Hi Hung Jung,
Did you set a 'Host' header in your request? Is
the request going straight to ZServer, or through
Apache? (Also... do you have a SiteRoot?) These can
all affect how the request is handled by the server...
It woould be interesting to try urllib, rather than
httplib since it handles the Host header for you...
-steve
>>>>> "Hung" == Hung Jung Lu <hungjunglu@hotmail.com> writes:
Hung> I can view certain document on a Zope site over the web if I
Hung> use a = brower. But for fun I tried to download it by using
Hung> Python's httplib, = and for some Zope sites got a status
Hung> code 302. This probably means I = need to use another URL
Hung> address. The web browser does this automatically = so I
Hung> don't need to do anything. But I can't seem to find the
Hung> right URL.=20
Hung> Reading from http://www.w3.org/Protocols/HTTP/HTRESP.html ,
Hung> it says that = when 302 happens, the header line would be
Hung> URI: <url> String CrLf
Hung> But I don't see this line in the returned header. And the
Hung> returned body = is an HTML telling me the document has been
Hung> moved. Funny thing is that = browsers (IE, Netscape) do not
Hung> have problems with it.
Hung> Is this a limitation of Python's httplib (not showing the
Hung> URI in the = response header)? Is there a way to circumvent
Hung> it? Or does this have to = do with virtual hosting, or
Hung> Apache stuff?
Hung> Thanks,
Hung> Hung Jung