Question How to receive JObject in post API?

sudarshanreddyc

New member
Joined
Aug 14, 2023
Messages
1
Programming Experience
1-3
I have a controller and an action method

It is a post method. Params look as follows
[FromBody JObject objParams].

But the objParams is alway coming as empty. But when I use int in place of JObject, it works fine. Can anyone please help me with this?
 
Did you run Fiddler or DevTools to verify that a JObject is really being POSTed to your action? If so, can you show us what is being POSTed?
 
Why do it? You're making the API, you get to specify the json that should be sent; create a class (or set of classes) that represent it and accept that
 

Latest posts

Back
Top Bottom