Return the boundary associated with the payload if present. The boundary is extracted from the Content-Type header's 'boundary' parameter, and it is unquoted.
(self, failobj=None)
| 864 | return utils.collapse_rfc2231_value(filename).strip() |
| 865 | |
| 866 | def get_boundary(self, failobj=None): |
| 867 | """Return the boundary associated with the payload if present. |
| 868 | |
| 869 | The boundary is extracted from the Content-Type header's 'boundary' |
| 870 | parameter, and it is unquoted. |
| 871 | """ |
| 872 | missing = object() |
| 873 | boundary = self.get_param('boundary', missing) |
| 874 | if boundary is missing: |
| 875 | return failobj |
| 876 | # RFC 2046 says that boundaries may begin but not end in w/s |
| 877 | return utils.collapse_rfc2231_value(boundary).rstrip() |
| 878 | |
| 879 | def set_boundary(self, boundary): |
| 880 | """Set the boundary parameter in Content-Type to 'boundary'. |