Opened 9 years ago
Last modified 9 years ago
#27384 closed Bug
Accessing request.POST in Django middlewares 1.10.x make it empty for view — at Initial Version
| Reported by: | Matheus Ashton Silva | Owned by: | nobody | 
|---|---|---|---|
| Component: | HTTP handling | Version: | 1.10 | 
| Severity: | Normal | Keywords: | middleware request.POST | 
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Hello, 
I'm creating a middleware to log every request in my API, following the new specification on django 1.10.x.
When I access the request.POST attr it goes blank to the view
Code highlighting:
def log_request_middleware(get_response): logger = logging.getLogger('requests') def middleware(request): request_body = request.POST.copy().dict() response = get_response(request)
The request.POST on the view now is blank, it happens even with a simple access a print or assignment.
It also happens with request.GET
  Note:
 See   TracTickets
 for help on using tickets.