我的 API 有一个我需要调用的 [HttpPatch] 操作。
[HttpPatch("{id}")]
public StatusCodeResult Patch(int id, [FromBody]JsonPatchDocument<Reservation> patch)
{
Reservation res = Get(id);
if (res != null)
{
patch.ApplyTo(res);
return Ok();
}
return NotFound();
}
我正在从 HttpClient 类尝试它,但它没有 .PatchAsync()
方法?
参数也是类型的JsonPatchDocument<Reservation>
,那么在调用此操作时如何从客户端发送它?
请帮忙