[Zope] How do I get remote http error code?

Chris Withers chrisw@nipltd.com
Thu, 21 Nov 2002 11:15:10 +0000


Duane Raymond wrote:
> I used httplib (adapting code from
> http://www.python.org/doc/lib/httplib-examples.html)
> 
>     conn = httplib.HTTPConnection(urldomain)
>     conn.request("GET", urlpath)
>     r1 = conn.getresponse()
>     pgStatus = [r1.status, r1.reason]
> 
> where urldomain = domain name (www.xyz.com) and urlpath is any bit after the
> domain.

Getting this to work with HTTP basic auth is a bit of a PITA, though ;-)

Chris