I want to get the value of the key 'result' but every time I'm trying to get it it becomes empty
if request.method == 'POST':
result = request.POST
as you can see there is something there but when I'm trying to print:
request.POST.get('result')
or
request.POST['result']
I'm getting an empty string
Try this values = request.POST.getlist('result')
, as request.POST.get('result')
returns only the last element in array, it's ''
in your case. Check this discussion.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.