I'm creating a simple Web API using .Net core 3.1 and I am having issues successfully posting a dictionary using Postman.
I have the following controller action:
[HttpPost("{id}/metas")]
[ProducesResponseType(typeof(Meta), 201)]
public async Task<IActionResult> CreateMeta([FromForm] NewMeta newMeta)
{
return Ok();
}
The NewMeta currently looks like this:
public class NewMeta
{
/// <summary>
/// File descriptors
/// </summary>
public Dictionary<string, object> Refs { get; set; }
/// <summary>
/// Associated file
/// </summary>
public IFormFile File { get; set; }
}
I am trying to use Postman to POST dictionary data as well as a file.
I've tried using the various Key/Value settings within postman. An example shown in the images.
Results in :
How can i pass in a value? This API is early in its development so I can change anything that is needed.