I have a ASP.Net Core WebApi with a update Action as follows:
[HttpPut("{id}")]
public async Task<IActionResult> Campaigns(long id, JObject jobject)
{
}
The request and response when I hit this endpoint from postman are below:-
{
"Zone_Code": 1,
"State_Code": 24,
"City_Code": 25,
"Sales_Associate": null,
"Operation_Associate": null,
"Traveller": null,
"Target_Sector": 5,
"Campaign_DateTime": "2020-04-04T00:00:00",
"Format": 2,
"Campaign_Name": "Test",
"Data_Criteria": null,
"IsActive":"Y",
"Stage": "Initiation"
}
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "|58a198b0-4ac4ca0838cdebce.",
"errors": {
"$": [
"The JSON value could not be converted to Newtonsoft.Json.Linq.JToken. Path: $ | LineNumber: 1 | BytePositionInLine: 8."
]
}}
JObjectlike a parameter of the action?you can use a simple objectJObjectgives me the same error, and with a simple object i'm calling the Action.