I have a Flask application running in python. There is a client that is serving images from disk. I would like a server to hit an end point and retrieve the images.
On the client's side:
@app.route('/api/get_image')
def get(self, id):
# Map id to filename.
return send_file(filename)
This works when I call the client's end point from a browser.
On the server side, I have a similar function that should call the above endpoint.
@app.route('/api/get_image')
def get(self, id):
return requests.get(client_url + '/api/get_image')
When I call the server endpoint, I get:
TypeError: <Response [200]> is not JSON serializable
But it doesn't work even if I try .json(). How do I return the image payload?