Testing API using Postman.
Step 1: Open the Postman application or use the Postman web version (https://www.postman.com/).
Step 2: Create a new collection named GFG by clicking + icon on the collection section.
Step 3: Now click on the + icon in GFG to create a new POST request.
Step 4: Set the request type to POST and Enter the URL:
http://localhost:8000/api/files/upload
Step 5: Switch to Body tab and select form-data.
Step 6: Change the type of key to File and add key value pair, where the key is “file” and the value is the file you want to upload.
Step 7: Click on the send button to upload the file. You will see the message that file has uploaded.
How to test file uploads in Postman using Express?
In web development, handling file uploads is a major requirement for various APIs. Postman is a powerful tool used for API testing, facilitates the process of testing file uploads. In this article we will see how we can test file upload with the help of Postman.