Get the first header value for 'name' Return None if the header is missing instead of raising an exception. Note that if the header appeared multiple times, the first exactly which occurrence gets returned is undefined. Use getall() to get all the values matching a
(self,name)
| 72 | self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] |
| 73 | |
| 74 | def __getitem__(self,name): |
| 75 | """Get the first header value for 'name' |
| 76 | |
| 77 | Return None if the header is missing instead of raising an exception. |
| 78 | |
| 79 | Note that if the header appeared multiple times, the first exactly which |
| 80 | occurrence gets returned is undefined. Use getall() to get all |
| 81 | the values matching a header field name. |
| 82 | """ |
| 83 | return self.get(name) |
| 84 | |
| 85 | def __contains__(self, name): |
| 86 | """Return true if the message contains the header.""" |