Yields a dictionary with the HTTP response headers.
(self, timeout=10)
| 459 | |
| 460 | @property |
| 461 | def headers(self, timeout=10): |
| 462 | """ Yields a dictionary with the HTTP response headers. |
| 463 | """ |
| 464 | if self.__dict__["_headers"] is None: |
| 465 | try: |
| 466 | h = dict(self.open(timeout).info()) |
| 467 | except URLError: |
| 468 | h = {} |
| 469 | self.__dict__["_headers"] = h |
| 470 | return self.__dict__["_headers"] |
| 471 | |
| 472 | @property |
| 473 | def redirect(self, timeout=10): |