Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'Request' object has no attribute 'Get' while making a GET request

I am trying to make a Get request , but am getting this error :

AttributeError: 'Request' object has no attribute 'Get'

Below is my code :

class VerifyEmail(APIView):
    """Verify user account."""

    serializer_class = EmailVerificationSerializer

    def get(self, request):
        """Obtain email token."""
        token = request.Get.get('token')
        payload = jwt.decode(token, settings.SECRET_KEY)

In the urls.py :

path('email-verify/', views.VerifyEmail.as_view(), name='email-verify'),

The issue is on this line :

token = request.Get.get('token')

What could be the issue for this ?

like image 453
Lutaaya Huzaifah Idris Avatar asked Dec 20 '25 10:12

Lutaaya Huzaifah Idris


1 Answers

token = request.Get.get('token')

this should be token = request.GET.get('token')

GET in all capital

like image 125
Dev Sapariya Avatar answered Dec 22 '25 23:12

Dev Sapariya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!