In your case you send the data in url so access the data through request.GET
as follow:
username = request.GET.get('Username')
start_date = request.GET.get('startDate')
# ... the same for all the other parameter after the `?` marque.
In fact there is a difference between request data
, request.body
, request.GET
and request.POST
:
- If you are sending POST request to django function view or class based view: you access the request data in
request.body
or request.POST
.
- If you are sending POST request to Django REST Framework: you access the data in
request.data
. You may also find in Internet request.DATA
that correct but it's deprecated in the newer version of DRF in favor of request.data.
- If you send parameter in the url like in you case, you access the data form
request.GET
as explained above.