我有一个带有更新操作的 ASP.Net Core WebApi,如下所示:
[HttpPut("{id}")]
public async Task<IActionResult> Campaigns(long id, JObject jobject)
{
}
Run Code Online (Sandbox Code Playgroud)
当我从邮递员点击这个端点时的请求和响应如下:-
{
"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."
]
}}
Run Code Online (Sandbox Code Playgroud) json.net ×1