Well, i want to deserialize the JSON into .Net object. I've using a class for it, but it seems like throwing an error.
Me._konten
contains this string
{
"status": true,
"content": {
"status": "up",
"ver": "3.0.1",
"gen": "a"
}
}
here's the converter
Public Async Function JSONify() As Task(Of APIResponseJSON)
Dim hasil As Object = Await _
Task.Run(Function()
Return JsonConvert.DeserializeObject(Of APIResponseJSON)(Me._Konten)
End Function)
Return hasil
End Function
so, the content part is really unpredictable, it may be a array, or other object. This was the class that i've made:
Public Class APIResponseJSON
Public Property status As Boolean = False
Public Property content As Object = New Object
End Class
and then, when i test it, this shows that the "status" in the "content" are not found. Throwed Exception by UnitTesting
So How to make the content
member are really dynamic?
EDIT
the content may be like this tooo
{
"status": false,
"content": {
"detail": {
"status": "Not Found",
"code": 404,
"text": "HTTP 404 (GET \/info)",
"trace": ""
}
}
}