Changes between Initial Version and Version 1 of Ticket #27384
- Timestamp:
- Oct 25, 2016, 10:16:38 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27384
- Property Component Uncategorized → HTTP handling
- Property Resolution → worksforme
- Property Status new → closed
-
Ticket #27384 – Description
initial v1 3 3 I'm creating a middleware to log every request in my API, following the new specification on django 1.10.x. 4 4 5 When I access the request.POST attr it goes blank to the view5 When I access the `request.POST` attr it goes blank to the view. 6 6 7 {{{ 8 #!div style="font-size: 80%" 9 Code highlighting: 10 {{{#!python 11 def log_request_middleware(get_response): 12 logger = logging.getLogger('requests') 7 {{{#!python 8 import logging 13 9 14 def middleware(request): 15 request_body = request.POST.copy().dict() 16 response = get_response(request) 17 }}} 10 def log_request_middleware(get_response): 11 logger = logging.getLogger('requests') 12 13 def middleware(request): 14 request_body = request.POST.copy().dict() 15 response = get_response(request) 16 return response 17 return middleware 18 18 }}} 19 19 20 The request.POSTon the view now is blank, it happens even with a simple access a print or assignment.20 The `request.POST` on the view now is blank, it happens even with a simple access a print or assignment. 21 21 22 It also happens with request.GET22 It also happens with `request.GET`.