In the method of the class urllib2.HTTPDefaultErrorHandler
what so the arguments - self
, req
, fp
, code
,msg
, hdrs
- refer to?
views:
54answers:
2
A:
- Req refers to request object usually contains HTTP method and url
- code refers to response code or HTTP code value like 200 etc
- hdr refers to headers of the request like user-agent etc
- fp refers to file descriptor or socket descriptor in this case
pyfunc
2010-10-18 18:05:26
+3
A:
What does the documentation say?
req
will be a Request object, fp
will be a file-like object with the HTTP error body, code
will be the three-digit code of the error, msg
will be the user-visible explanation of the code and hdrs
will be a mapping object with the headers of the error.
eumiro
2010-10-18 18:06:13