c# - JSON Parsing error -Invalid Character at position 0 -


i trying parse click method

using windows.data.json;  private async void getjson_click(object sender,routedeventargs e)  {     var client=new httpclient();    client.maxresponsebuffersize=1024*1024;    var response= await client.getasync(new uri(the url here));    var result = await response.content.readasstringasync();     var component=jsonarray.parse(result);  } 

the following error message - winrt information :invalid character @ position 0. invalid json string.

this json data trying parse: {"x-yz-12345/ab.cd" :{"pm1":"f","pm2":"47.12"}}

any highly appreciated.

it not array object. try jsonobject.

string result = @"{""x-yz-12345/ab.cd"" :{""pm1"":""f"",""pm2"":""47.12""}}"; var jobj = jsonobject.parse(result); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -