Running a Postman API using Newman command which currently uploads a single file. My requirement is to upload multiple files using this same API.
My current code which uploads a single file looks like this:-
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"description": "Jpeg image or video (mov or mp4)",
"type": "file",
"src": "C:\\Test\\abc.jpeg"
}
]
}
In this very same code, I want to upload multiple files. Need some direction on how can I achieve it.
I post multi file in postman/newman by sending multi POST requests - one file per request. So you can send many files executing one postman collection of requests.
Edit: Example of form with 2 file field:
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "myFile1",
"description": "Jpeg image or video (mov or mp4)",
"type": "file",
"src": "C:\\Test\\abc.jpeg"
},
{
"key": "myFile2",
"description": "Jpeg image or video (mov or mp4)",
"type": "file",
"src": "C:\\Test\\def.jpeg"
}
]
}