I have an API endpoint that dynamically generates an image based on some pass data. I would like to call the API and download the response into a file. What's the best way to accomplish this in Python?
The request looks like this in cURL:
curl https://localhost:4000/bananas/12345.png \
  -O \
  -X POST \
  -d '[ 1, 2, 3, 4 ]'