Reputation: 108
The following works when I paste it on the browser:
localhost://api/get_url.py?x=xxx&y=yyy
how can i store the values of x and y in a variable passing from url ?
Upvotes: 2
Views: 117
Reputation: 106936
The requests
module has made it really simple.
Please read: http://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls
import requests
response = requests.get('localhost://api/get_url.py', params={'x': x, 'y': y})
Upvotes: 1