Closed benfoster closed 8 years ago
Controller:
[HttpPatch] public IActionResult Patch(JsonPatchDocument<Contact> patch) { patch.ApplyTo(contact, ModelState); if (!ModelState.IsValid) { return new BadRequestObjectResult(ModelState); } return Ok(contact); }
When I make the following request:
PATCH /api/contacts HTTP/1.1 Host: localhost:51834 Content-Type: application/json-patch+json Cache-Control: no-cache [{ "op": "add", "path": "/firstname", "value": "John" }]
No operations are bound to the patch parameter and therefore no changes are made.
patch
Missing [FromBody]
[FromBody]
doh!
Controller:
When I make the following request:
No operations are bound to the
patch
parameter and therefore no changes are made.