Q:

Error read json string

i'm trying to read a json string from an http post, i'm trying to test my code by filling the json string manually but my problem is that i'm not able to add the same node many times.... in other words if i put the following it works:
    Dim json As String = "{'name': 'jocelyne','mo': '70274724'} 

but if i put the following it does not work:
    Dim json As String = "{'name': 'jocelyne','mo': '70274724'},{'name': 'eliane','mo': '12345678'}"

and i actually have hundred of names and mo numbers that will be sent to me in a json string
this is my entire code:
    Request.InputStream.Position = 0 'you need this else the magic doesn't happen
    Dim inputStream As New StreamReader(Request.InputStream)
    'Dim json As String = inputStream.ReadToEnd()
    Dim json As String = "{'name': 'jocelyne','mo': '70274724'},{'name': 'eliane','mo': '12345678'}"

    Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
    Dim dict As Dictionary(Of String, String) = jss.Deserialize(Of Dictionary(Of String, String))(json)

    For Each item As KeyValuePair(Of String, String) In dict
        Response.Write(item.Key & " - " & item.Value & "<br>")
    Next

so how can i fix this? i just need to be able to read this json format given to me using http post and deserialize it to read the data

A:

It is necessary to put whole string to brackets
Dim serializer As New Web.Script.Serialization.JavaScriptSerializer()
Dim json As String = "[{'name': 'jocelyne','mo': '70274724'},{'name': 'eliane','mo': '12345678'}]"
Dim tst = serializer.Deserialize(Of Object)(json)

The result is array of objects.

