How to upload a file and JSON data in Postman?

In postman, set method type to POST.

Then select Body -> form-data -> Enter your parameter name (file according to your code)

and on right side next to value column, there will be dropdown “text, file”, select File. choose your image file and post it.

For rest of “text” based parameters, you can post it like normally you do with postman. Just enter parameter name and select “text” from that right side dropdown menu and enter any value for it, hit send button. Your controller method should get called.

Leave a Comment