I have already searched for similar questions on StackOverflow but could not find the solution that would work for me. I have the following code snippet:
def post_request(request):
if request.method == "POST":
access_token = AccessToken.objects.get(token = request.POST.get("access_token"), expires__gt = timezone.now())
When I make the HTTP request to this function, I get the following error: AccessToken matching query does not exist. , I started debugging the app.
The problem is in request.POST.get("access_token")
request.POST = <QueryDict: {}> . I have no data in there
I am making a POST request in POSTMAN, where I added the data to body -> form-data. I also tried sending data through body->raw->json but anyway the request.POST does not contain anything.
What is the cause that I have no Post data? How can I get the POST data?
Thank you!
