MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_boundary

Method get_boundary

tools/python-3.11.9-amd64/Lib/email/message.py:850–861  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

848 return utils.collapse_rfc2231_value(filename).strip()
849
850 def get_boundary(self, failobj=None):
851 """Return the boundary associated with the payload if present.
852
853 The boundary is extracted from the Content-Type header's `boundary'
854 parameter, and it is unquoted.
855 """
856 missing = object()
857 boundary = self.get_param('boundary', missing)
858 if boundary is missing:
859 return failobj
860 # RFC 2046 says that boundaries may begin but not end in w/s
861 return utils.collapse_rfc2231_value(boundary).rstrip()
862
863 def set_boundary(self, boundary):
864 """Set the boundary parameter in Content-Type to 'boundary'.

Callers 2

_parsegenMethod · 0.80
_handle_multipartMethod · 0.80

Calls 2

get_paramMethod · 0.95
rstripMethod · 0.45

Tested by

no test coverage detected