The Client side receives a formal JSON content \"{\\\"Id\\\":[1,2,3],\\\"Size\\\":56}\"
, but get an error in deserialization the byte array.
1 Error occurs
In addition to Chris Hogan's reply, I'd like to point out that I got this error when RestSharp incorrectly used the default serializer instead of the custom JSON.NET serializer I had assigned.
The reason for this was that I added a handler with content type application/json
whereas the API I was getting the response from returned the content as text/json
.
So by changing the AddHandler
call to AddHandler("text/json", jsonDeserializer)
, I resolved the issue.