dimanche 28 mai 2017

JSON and Web API - how do I receive a simple JSON object into a Web API using built in types (without JQuery)?

I'm working on a system that sends a simple JSON object to a C# .NET Web API in the form:

{property1: "string1", property2: "string2"}

I want to receive this JSON into the web api. I can't initially use a custom object when I receive the JSON into the web API (because the system I'm working writes stuff into the DB automagically, and for this to work, only the built-in C# types can be used at the point that data reaches the web api).

The system doesn't utilise JQuery, so that's not an option. How can I accept this JSON into the Web API?




Aucun commentaire:

Enregistrer un commentaire