[Django] #12522: Unable to get request.POST after request.get_raw_post_data

3 views
Skip to first unread message

Django

unread,
Jan 6, 2010, 1:45:18 PM1/6/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
---------------------------+------------------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.1
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
I need to get raw request body, the only solution I found is
request.get_raw_post_data, but once I accessed it I am unable to use
request.POST anymore. From my point of view access to request.POST should
check if cached body data already exist and if yes try to use it instead
of reading environ['wsgi.input']

--
Ticket URL: <http://code.djangoproject.com/ticket/12522>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 7, 2010, 5:02:41 AM1/7/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by redbaron):

* needs_better_patch: => 0
* component: Uncategorized => HTTP handling
* needs_tests: => 0
* needs_docs: => 0

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:1>

Django

unread,
Jan 7, 2010, 6:57:10 AM1/7/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by redbaron):

* has_patch: 0 => 1

Comment:

Attaching patch which fixes problem for WSGI handler with regression tests
provided. Patch for mod_python is there too. Basically it fixes access to
request.POST and requst.raw_post_data in any order in case of multipart
POST content type.

I am not familiar with mod_python and don't know what is 'req' argument
passed by handler, thats why there are no regression tests for mod_python
handler.

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:2>

Django

unread,
Feb 9, 2010, 8:16:01 AM2/9/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by russellm):

* stage: Unreviewed => Accepted

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:3>

Django

unread,
Jul 29, 2010, 4:31:14 PM7/29/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Comment (by kmtracey):

#14024 reported this again and proposed a different approach to fix.

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:4>

Django

unread,
Jul 30, 2010, 11:44:02 AM7/30/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Comment (by zimnyx):

This issue is related: #14035 (Cannot access POST after request.encoding
was set to a custom value)

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:5>

Django

unread,
Nov 22, 2010, 11:25:02 AM11/22/10
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Comment (by zimnyx):

Another related issue: #14753 (Accessing (Get)HttpRequest.raw_post_data in
view results in exception during testing)

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:6>

Django

unread,
Jan 1, 2011, 3:35:35 PM1/1/11
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+---------------------------------------
Reporter: redbaron | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
------------------------------------+---------------------------------------
Changes (by ramiro):

* needs_better_patch: 0 => 1

Comment:

The patch doesn't apply anymore because a) Since then there has been a
code shuffle for the HTTPRequest streaming feature and b) Most of our
tests were converted to unit tests.

I've attached redbaron's tests updated to apply to trunk as of now. They
add two failing cases.

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:7>

Django

unread,
Apr 2, 2011, 1:03:42 AM4/2/11
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
------------------------------------+-----------------------------
Reporter: redbaron | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: HTTP handling
Version: 1.1 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 |
------------------------------------+-----------------------------
Changes (by mattmcc):

* type: => Bug
* severity: => Normal


--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:8>

Django

unread,
Apr 2, 2011, 4:37:28 PM4/2/11
to djang...@holovaty.com, django-...@googlegroups.com
#12522: Unable to get request.POST after request.get_raw_post_data
-------------------------------------+-----------------------------
Reporter: redbaron | Owner: nobody
Type: Bug | Status: closed
Milestone: | Component: HTTP handling
Version: 1.1 | Severity: Normal
Resolution: duplicate | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 |
-------------------------------------+-----------------------------
Changes (by vkryachko):

* status: new => closed
* resolution: => duplicate


Comment:

This is a duplicate of #15679

--
Ticket URL: <http://code.djangoproject.com/ticket/12522#comment:9>

Reply all
Reply to author
Forward
0 new messages