I have a list of URLs that all refer to images. I want to loop through the list and call a face recognition API that accepts these URLs. To call the API, I need to provide the payload dictionary. However, the example code from the API requires the following form for the payload dictionary:
payload = "{\"url\":\"https://inferdo.com/img/face-3.jpg\",\"accuracy_boost\":3}"
The URL in this example payload dictionary would look like this in my list:
list_of_urls = ["https://inferdo.com/img/face-3.jpg", ...]
How can I insert the entries of my list into the payload dictionary with a for loop?
I tried to use a "regular" payload dictionary, but it did not work:
for url_path in list_of_urls:
payload = {'url' : url_path,'accuracy_boost':3}