'Swift code example to post a IFormFile to Asp.Net Core 5.0 Api

Can anyone please suggest a swift code example to send a file to the below asp.net core method? Actually, file is being uploaded correctly from the postman, swagger but it is not working via swift. Thanks in advance...

[HttpPost("AddAttachment")]
    public async Task<IActionResult> AddAttachment([FromForm] IFormFile file)
    {
      
        return await _handler.AddAttachment(file);
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source