Adds a new body part to multipart writer.
(self, obj, headers=None)
| 901 | return params['boundary'].encode('us-ascii') |
| 902 | |
| 903 | def append(self, obj, headers=None): |
| 904 | """Adds a new body part to multipart writer.""" |
| 905 | if isinstance(obj, self.part_writer_cls): |
| 906 | if headers: |
| 907 | obj.headers.update(headers) |
| 908 | self.parts.append(obj) |
| 909 | else: |
| 910 | if not headers: |
| 911 | headers = CIMultiDict() |
| 912 | self.parts.append(self.part_writer_cls(obj, headers)) |
| 913 | return self.parts[-1] |
| 914 | |
| 915 | def append_json(self, obj, headers=None): |
| 916 | """Helper to append JSON part.""" |
no outgoing calls