how to write Query Parameters In Django
This is for freshers like me, Those who are strugle with how send data based on Request query params in django.
TYPE-1:
http://localhost:8000/api/abscs/?id=2
userid = request.query_params.get("userid")
result is saved on userid= "2"
TYEP-2:
http://127.0.0.1:8000/aAF/?status=omn&status=aad
which will correctly give you ['omn','aad'] when you use request.GET.getlist('status')
Comments
Post a Comment