I have been looking around for a few days now and cannot figure this out. Basically I'm uploading an image to a server and get an ID in return, the problem is I cannot figure out how to extract this ID and change it into a String ready to be saved into a database.
Program Code
url =
with open("image.jpg", "rb") as image_file:
files = {'file': image_file}
auth = ('', '')
r = requests.post(url, files=files, auth=auth)
data = r.json()
uploaded = data.get('uploaded')
content_id = uploaded[0]
print r
print r.text
print '--------------'
print str(content_id)
And here is the output I get
{
"status": "success",
"uploaded": [
{