-2
I am using the Newtonsoft.Json.Linq library to parse json in c#. Until now it worked beauty, when I have a string json like this:
{
'chave':'valor'
}
But when I have a json like this:
[
{
'chave':'valor'
},
{
'chave':'valor',
'outrachave':'outrovalor'
}
]
PS: This json is coming from the mysql database, it comes converted into html URI format, by javascript, in a mysql column, I connect in the database with c#, recover this value and use the following
string json = Uri.UnescapeDataString(pedido).ToString();
So I pick up the json, and try to parse it like this
JToken result = JObject.Parse(json);
And the error is as follows: Error Reading Jobject from Jsonreader item is not an Object
Does this library not accept even when it is square bracket?
Ever tried to "escape", put a ' ' before, like this ' \[ ' ?
– bio
Hi, I added some information to the question....
– Shari Sharu
That I knew,
json
unaccepted'
(single quotes) and yes"
(double quotes). Ides always accuse this as a mistake.– Wallace Maxters