MCPcopy
hub / github.com/encode/django-rest-framework / _load_stream

Method _load_stream

rest_framework/request.py:297–314  ·  view source on GitHub ↗

Return the content body of the request, as a stream.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers 1

streamMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected