我在RestSharp的RestClient中使用POST方法和JSON修补程序操作(请参阅RFC:http://tools.ietf.org/html/rfc6902)有问题。 AddBody()包含这样的内容:restclient是否支持json-patch?
request.AddBody(new { op = "add", path = "/Resident", value = "32432" });
它出错了。我不知道如何通过json-patch
在身体中的操作。我尽我所能去尝试。有没有解决这个问题的方法?
您是否尝试过使用参数,而不是AddBody? – Prix
看来我已经克服了这个问题,但问题仍然有效,因为我的错误描述已经改变。错误描述如下:{“type”:“error”,“status”:415,“code”:“unsupported_media_type”,“help_url”:“http:\/\/\ /#errors”,“message” :“Content-Type必须是应用程序\/json-patch + json”,“request_id”:“1953d8ac6”}我得到unsupported_media_type错误,并在restclient.execute()方法中引发错误。有没有办法解决这个问题? – user3231144
Prix,是的,我曾尝试参数,但没有奏效,但无论如何,我现在能够在体内传递操作,但问题与json-patch有关。看来execute()方法不支持json-patch响应。有任何想法吗? – user3231144