My intention is to upload an image and do some image processing. For now, I intend to render the uploaded image.
I used the code here to build my front end and I wrote the backend in python using bottle, which is as follows:
@route('/test', method='POST')
def serve_image():
# import pdb; pdb.set_trace()
image = Image.open(request.body)
image.show()
I get an errors as follows
OSError: cannot identify image file <_io.BytesIO object at 0x0000017386B53A40>
What am I missing?
EDIT: When I print the whole request, this is what I get
< http://localhost:8080/test>