@api_view(['GET',])
@permission_classes([IsAuthenticated])
def Reservation_get(request):
if request.method == 'GET':
Date = request.data['date']
ress = reservation.objects.filter(date=Date)
serializer = ReservationSerializer(ress, many=True)
if ress.exists():
response = {'message': 'this/these date already chosen in restaurant', 'result': serializer.data}
return Response(response)
else:
return Response(serializer.data)
my views
File "D:\#py\git projects\company Project\last\api\reservation\views.py", line 68, in Reservation_get Date = request.data['date'] KeyError: 'date' [21/Mar/2020 03:29:19] "GET /reservation_get/ HTTP/1.1" 500 99859
我的GET适用于邮递员,但正常的网址显示错误