Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

POSTed jason but structure is dynamic

$
0
0

all example I have seen rely on knowing the structure of the json payload, assuming staticity, however, that is not always the case.

using WEBAPI, I have...

Public Function PostValue(<FromBody()> ByVal value As String) As Object

<-- here is where I want to read the incoming json object - not knowing its exact structure  - that said, there are structural constants - some elements repeat consistently - but then other are added or remove - ...I would need access to just a few of the constant elements (3) out of ..many...

Dim JsonReturnPayload As Object = JObject.Parse("{'fulfillmentText':'HELLO '}")
Return (JsonReturnPayload)
End function

I will add that value always seems to return null - I get an exception - but I do know the controller is being called and that the returned Json object is being consumed.
I would think value should not be null ....??? the data is POST data

Sorry for being stuck on this...

Thanks


Viewing all articles
Browse latest Browse all 4850

Trending Articles



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