I am trying to send an image to my API and then get results back from it. For example I send a bmp image file using
file = {"img": open("img.bmp)}
r = requests.post(url, files = file)
Now I'm getting stuck on how to read the result from the API.
Usually we have a data value we send to API and get results as
data = {"data":"MyDataString"}
r = requests.get(url, params = data)
But I need to send an Image. I tried looking for ways to send image in a GET request or use r.content with the POST request but couldn't make it work.
For better visualizing the problem here is an example: Consider an API where you send an image and get the processed image in result.
Hopefully you can guide me in the right direction.