Discussions
Iam getting invalid URL error when iam trying to upload image
almost 2 years ago by drakewc
Hi,
Iam getting Invalid URL error, when iam trying API with http, Here is the code i made
import requests
imgLoc = r"Eric Headshot 2.png"
url = "https://api.d-id.com/images"
files = { "image": (imgLoc, open(imgLoc, "rb"), "image/png") }
headers = {
"accept": "application/json",
"authorization": "Basic MYAPIKEY"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)
Here is the error log
{"kind":"InvalidFileNameError","description":"invalid file name","details":{"url":"Eric Headshot 2.png"}}