I'm surprised I can't find an answer to this already but I'm trying to export the posted content (in this case json) prior to Deserialization and ModelMapping in a asp.net web api.
I need to do this to debug an issue I'm seeing with the deserialization of the json. This is the exception I'm getting in
Bad JSON escape sequence: \U. Path 'ABCData', line 1, position 2056.
This exception happens within the nested calls starting with:
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
I have turned on failed request logging in IIS but this issue happens very sporadically and I'm unable to reliably capture it. So I was hoping that I could just find a way to export the request content every time before it's deserialized. I've also turned on web api logging but it doesn't appear to dump this information.
Is there a simple way to do such a thing?