Return the content body of the request, as a stream.
(self)
| 295 | self._request._files = self.FILES |
| 296 | |
| 297 | def _load_stream(self): |
| 298 | """ |
| 299 | Return the content body of the request, as a stream. |
| 300 | """ |
| 301 | meta = self._request.META |
| 302 | try: |
| 303 | content_length = int( |
| 304 | meta.get('CONTENT_LENGTH', meta.get('HTTP_CONTENT_LENGTH', 0)) |
| 305 | ) |
| 306 | except (ValueError, TypeError): |
| 307 | content_length = 0 |
| 308 | |
| 309 | if content_length == 0: |
| 310 | self._stream = None |
| 311 | elif not self._request._read_started: |
| 312 | self._stream = self._request |
| 313 | else: |
| 314 | self._stream = io.BytesIO(self.body) |
| 315 | |
| 316 | def _supports_form_parsing(self): |
| 317 | """ |