'Error sending request to api in django rest framework
I am requesting an API and I will send the information by mail And says in reply "detail": "Method "POST" not allowed."
View :
@api_view(["POST"])
def create(request):
info = UsersSerializers(request.data)
if info.is_valid():
UsersC(name=info.validated_data['name'],age=info.validated_data['age'],email=info.validated_data['email']).save()
return Response({'message': 'created'})
else:
return Response(info.errors)
Response
{
"detail": "Method \"POST\" not allowed."
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
