swagger-ui
swagger-ui copied to clipboard
Arbitrary number of key values in the POST body
Content & configuration
Im using Swashbuckle.ASPNetCore 6.4.0 and have an API Controller listening for a POST request
[HttpPost("test")]
[Consumes(MediaTypeNames.Application.FormUrlEncoded)]
public IActionResult Test([FromBody] string content)
Which shows up in SwaggerUI and I have the option to add content for the body which I add key=1&val=1, but the curl generated looks as follows... it needs to support an arbitrary amount of random key value pairs.
curl -X 'POST'
'http://localhost:8001/config/test'
-H 'accept: /'
-H 'Content-Type: application/x-www-form-urlencoded'
-d '0=k&1=e&2=y&3=1&4=%3D&5=v&6=a&7=l&8=1'
How can I make it not split the string??