Answer the question
In order to leave comments, you need to log in
How to get value from body?
I'm sending a POST request from the front to the back. The backend uses the following version of django:
>>> import django
>>> django.VERSION
(1, 8, 7, 'final', 0)
@csrf_exempt
def login(request):
result = request.body.decode("utf-8")
print('-----', result)
return JsonResponse({'isLogged': 'True'})
System check identified no issues (0 silenced).
January 01, 2021 - 13:56:57
Django version 3.1.4, using settings 'qwe.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
-----
[01/Jan/2021 13:57:00] "OPTIONS /login HTTP/1.1" 200 20
----- {"login":"we","password":"eeee"}
[01/Jan/2021 13:57:00] "POST /login HTTP/1.1" 200 20
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question