url = ("websitetogetdatafrom/vandcenter syd/sites/"
"{}/histdata0/youngest".format('vestre boulevard f77r370 -ny logger 1'))
stuff = "\"select\": [\"{}\"]".format('ui2')
full_url = quote(url + "{{" + stuff + "}}")
print(full_url)
payload = {}
headers = {'Authorization': 'autherization token'}
response = requests.request("GET", full_url, headers=headers, data=payload)
print(response.json())
I am trying to get a timestamp of data, I cannot get the data as the url that comes out: https://websitetogetdatafrom/vandcenter%20syd/sites/vestre%20boulevard%20f77r370%20-ny%20logger%201/histdata0/youngest{"select":%20["ui2"]}
The last bit {"select":%20["ui2"]} does not get turned into the url. I am looking into uirllib.parse but find it quite complicated. So was wondering if you people know how to turn a string with special characters like { and " into a functioning url request.
Using python 3.7 with requests library.