debuggingpostpostmaniformfile

How to test a POST call that sends a list of objects that contain a list of IFormFiles for multiple file upload via Postman?


This is the shape of my DTO:

 public class PacketDto
    {
        public string TransmittedAt { get; set; }
        public List<Logs> Files { get; set; } = null!;

        public class Logs
        {
            public LogTypeEnum LogType { get; set; }
            public List<IFormFile> LogFiles { get; set; }
        }
    }

I have been trying to test my endpoint via postman, however I am having issues with mapping a List<IFormFile> to the Logs object. Everything else maps correctly. Would anyone have any idea what I am doing wrong when passing data in my form on postman? I have tried the following variations in structuring my data :

enter image description here

enter image description here

enter image description here


Solution

  • This is how i had to format my form-data in postman enter image description here