On Mon, 2009-05-11 at 11:47 -0700, Roodie wrote: > Now that's interesting. Must be some mis-configuration on the > server side, since I can see the URL just fine, both in my bowser > and from the python console:
What do you mean by "see", especially for the browser case? Sure, it returns something, which includes a lot of HTML and stuff that renders as a pretty page. But if you look at the response code (well, at least when I retrieve it), it's a 404 status code along with the result. Which means it's an error. > > >>> from httplib import HTTP > >>> from urlparse import urlparse > >>> p = urlparse('http://www.harmat.hu/') > >>> h = HTTP(p[1]) > >>> h.putrequest('HEAD', p[2]) > >>> h.endheaders() > >>> r = h.getreply() > >>> r > >>> (200, 'OK', <httplib.HTTPMessage instance at 0x2133ecd8>) > > Interesting, thanks anyway. Odd. I see the same thing when using this code (including the 200 response code). But with curl, doing the same thing shows what my browser also sees: .-(malc...@djelibeybi 12:20:44) ~ `--> curl -I http://www.harmat.hu/ HTTP/1.0 404 Not Found Date: Mon, 11 May 2009 19:21:13 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.5 X-Powered-By: PHP/5.2.5 Set-Cookie: e0684035deff8b575dbd8aa4713e608b=-; path=/ Set-Cookie: lang=deleted; expires=Sun, 11-May-2008 19:21:12 GMT; path=/ Set-Cookie: mbfcookie=deleted; expires=Sun, 11-May-2008 19:21:12 GMT; path=/ Set-Cookie: mbfcookie[lang]=hu; expires=Tue, 12-May-2009 19:21:13 GMT; path=/ Set-Cookie: mosvisitor=1 Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Mon, 11 May 2009 19:21:13 GMT Cache-Control: no-store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Pragma: no-cache Connection: close Content-Type: text/html I don't really have time at the moment to dig any deeper, but that's a bit strange, for sure. The difference, by the way, between the two cases is that you send no extra headers in your Python example, whereas curl and the browser send a bunch of stuff, including the UserAgent and Host headers (even if I force curl to use HTTP/1.0, like your Python code does). Django also sends a bunch of headers, including User-Agent. There's something odd about the way that server is set up, it seems. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---