I'm getting a HttpResponse and trying to deserialize it by doing this:
response = (HttpWebResponse)request.GetResponse();
Stream objStream = response.GetResponseStream();
BinaryReader breader = new BinaryReader(objStream);
byte[] buffer = breader.ReadBytes((int)response.ContentLength);
The format is MsgPack. If I call the following code, it give me JSON like this:
var unpackKNN = MessagePack.MessagePackSerializer.ToJson(buffer);
Json
{
"__schema":{
"__level0":"result|status",
"__level1":"token|status|total|amount|details|id|name|category|cat|group",
"__level2":"method|code|timestamp|result"
},
"data":[
"__level0",
[
"__level1",
"abcd",
"true",
100,
200,
"xyz",
12345,
"Giraffe",
"1",
"One",
"First"
],
[
"__level2",
"request",
"SUCCESS",
15000000000,
"Success"
]
]
}
How should I proceed to deserialize this into a JSON array or dynamic object? Do I need to write a resolver that suits the structure of the message?
Would appreciate any help with this.