I'm trying to make a put request to the local server using the put request using curl:
curl -X PUT -H "Content-Type: application/json" -d '{"connid":"12"}' "127.0.0.1:8000/api/kill"
I receive the same response:
'WSGIRequest' object has no attribute 'PUT'
for the following code:
def kill(req):
conid = req.PUT['connid']
statusres = {}
if conid in state:
error[conid] = 'true'
statusres['status'] = 'ok'
else:
statusres['status'] = 'invalid connection Id : '+ conid
return JsonResponse(statusres)
I also used @csrf_exempt
before the function.