What is the data file that should be provided in Postman runner to execute multiple calls to a POST endpoint that expects multiplart/form-data?
I have an Azure function which looks like this (simplified for this post):
[FunctionName("UploadImage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log)
{
var form = await req.ReadFormAsync();
if (!form.Files.Any()) return new BadRequestObjectResult("form.Files is empty");
var uploadedFile = form.Files.First();
form.TryGetValue("fileName", out var fileNames);
return new OkObjectResult($"Uploaded image length: {uploadedFile.Length} file name {fileNames.First()}");
}
I use Postman to send it a request successfully like this: Postman request body params
I want to call this function 100 times concurrently to test its performance using the "Run Collection" selection of Postman. It asks to provide a csv datafile. So I tried a file that has only 2 lines like this:
FileName, Photo
Attachment1, Regina.jpg
But it does not work with that data file. I get a response message that "form.Files is empty"
How to correctly provide a data file for this Postman runner to test calling the endpoint (n) times async?