Below is my Json input from Ui:
{ "data": [{ "Id": 1 }, { "Id": 2 }, { "Id": 3 }] }
I can get it without problems in the structure of objects shown below:
public class TestController : ApiController {
However, my goal is to get the following API method:
[HttpPost] [Route("api/TestJsonInput")] public string TestJsonInput1([FromBody] string input) { return input; }
The reason for this requirement is that I do not use a Json object that is de-serialized through the Web API, I just need to store the actual Json in the database and retrieve and return to the Ui that will parse it.
As I canβt get in the input line, as suggested, so I have to perform an additional step of Json serialization, de-serialization to achieve the goal. Any mechanism for me to avoid this workaround completely by getting in line and using it directly. I am currently testing Postman
source share