Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Creating an Endpoint that can read any json. A generic endpoint API

$
0
0

So I have a requirement to have one endpoint that can read json payload that can hit it from different system. We have several partners that would be posting data to our system.  So we want one endpoint that would handle getting data from any of our partners posting data.

I have something like this already.

[HttpPost]
public string Getdata([FromBody]Object data)
{

  //how do I convert it to the specific class that sooths the  json payload.

  //Or how do I read the data attribute of the object data pasted without knowing the payload structure.
}

I need to be able to create a generic json reader like this system here

https://quicktype.io/csharp/

So when data hits me I can read the data.

Best Regards,

Thanks in Advance


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>