Search code examples
pythonpostmanflask-restful

How to send an image to a flask server using Postman


I need to send an image file to a flask server using Postman.I did send it using a web browser and "render template".But when i tried the same program with postman it showed "method not allowed"

Postman 405.

I also tried /upload, but it says "bad request"

Postman 400


Solution

  • To make this work you'll need this:

    • add upload in your URL in postman.
    • add header Content-Type multipart/form-dataitem
    • enter file as key for row in form data where you choose your file. On the screenshots I see that it is empty.