tags:

views:

54

answers:

2

In the method of the class urllib2.HTTPDefaultErrorHandler what so the arguments - self, req, fp, code,msg, hdrs - refer to?

A: 
  1. Req refers to request object usually contains HTTP method and url
  2. code refers to response code or HTTP code value like 200 etc
  3. hdr refers to headers of the request like user-agent etc
  4. fp refers to file descriptor or socket descriptor in this case
pyfunc
+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