I am writing a GET request that takes three query paramters in the end of the URL
Now a URL in my list of urls is
(r'/v1/random/data?{}' .format(urllib.urlencode(args)) , 'GET', getResource),
The method getResource redirects to a class where the parameters are to be extracted from the URL I have printed the local variables using locals() in that particular method and they are as such
{'res': {}, 'args': 'data', 'uri': '/v1/random/data', 'entities': ['', 'v1', 'random', 'data'] }
The curl request for the above output is
curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://<ip>:<port>/v1/<random>/data?param1=1¶m2=2
I want to be able to extract the parameters param1 and param2 from my curl request. How should I implement this in Python ?
IF you dont understand the error above, I want to create an API in python such that
curl "http://localhost:5000/pulse/?lat=41.225&lon=-73.1"
that is able to accept two values in a GET request