Opened 15 years ago
Closed 14 years ago
#12522 closed Bug (duplicate)
Unable to get request.POST after request.get_raw_post_data
Reported by: | Maxim Ivanov | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | 1.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
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 environwsgi.input
Attachments (2)
Change History (11)
comment:1 by , 15 years ago
Component: | Uncategorized → HTTP handling |
---|
by , 15 years ago
Attachment: | raw_post.diff added |
---|
comment:2 by , 15 years ago
Has patch: | set |
---|
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.
comment:3 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:5 by , 14 years ago
This issue is related: #14035 (Cannot access POST after request.encoding was set to a custom value)
comment:6 by , 14 years ago
Another related issue: #14753 (Accessing (Get)HttpRequest.raw_post_data in view results in exception during testing)
comment:7 by , 14 years ago
Patch needs improvement: | set |
---|
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.
comment:8 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:9 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is a duplicate of #15679
Fix patch + regression tests on WSGI handler