I am getting 405 error for get method in my django api, instead, i want a default message for get method

For django API, which we have written, post method is allowed but instead of get method, i am getting 405 error, but instead i want some default message like- "error". I am sharing my code. Please let me know if anyone can help.

@api_view(['GET']) @permission_classes([AllowAny])

Error which i am getting in my script is : "GET /hashtaggenerator HTTP/1.1" 405 40 and on postman i am getting: { "detail": "Method "GET" not allowed." }

Back to Top