Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
3cdb4e26
Commit
3cdb4e26
authored
Apr 03, 2011
by
tom christie tom@tomchristie.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporarily roll back the streaming stuff
parent
4687db68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
djangorestframework/request.py
+12
-4
No files found.
djangorestframework/request.py
View file @
3cdb4e26
from
djangorestframework.mediatypes
import
MediaType
#from djangorestframework.requestparsing import parse, load_parser
from
django.http.multipartparser
import
LimitBytes
from
StringIO
import
StringIO
class
RequestMixin
(
object
):
...
...
@@ -65,10 +66,17 @@ class RequestMixin(object):
Returns an object that may be used to stream the request content.
"""
if
not
hasattr
(
self
,
'_stream'
):
if
hasattr
(
self
.
request
,
'read'
):
self
.
_stream
=
self
.
request
else
:
self
.
_stream
=
StringIO
(
self
.
request
.
raw_post_data
)
request
=
self
.
request
# We ought to be able to return a stream rather than reading the stream.
# Not quite working just yet...
#if hasattr(request, 'read'):
# try:
# content_length = int(request.META.get('CONTENT_LENGTH',0))
# except (ValueError, TypeError):
# content_length = 0
# self._stream = LimitBytes(request, content_length)
#else:
self
.
_stream
=
StringIO
(
request
.
raw_post_data
)
return
self
.
_stream
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment