Postman is an API testing/automating tool supports different kind of API calls REST, SOAP, and Plain HTTP with different data schemas.
If you are new to Postman, go over the below link to download and install it in your machine.
Once installed, open the postman, your workspace looks somewhat similar below!!
Here, we go over how to test multipart file upload API using Postman UI.
Follow the below-mentioned steps as per the highlighted sections in the above picture.
1. Select API method to POST
2. Enter your backend API in the URL section ( URL shown in picture is for example purpose only!)
3. Select the body section
4. Choose form-data option
5. Provide key name same as backend API parameter name
6. Select file to upload from your system
Just click Send to test your API.
Curl is a command-line tool to test URLs requests with different data.
Widely used on servers with terminal commands.
Go over the below link to know more about Curl.
If you are using the mac system, install using brew with below command from the terminal.
$ brew install curl
For Linux system (Ubuntu):
$ apt-get install curl
Curl command to post form data to API
$ curl -X POST –form “[email protected]” http://localhost:8888/codetips/uploadFile