Error parsing JSON data packet Home › Forums › kbmMW › Error parsing JSON data packet Tagged: Delphi kbmMW JSON This topic contains 3 replies, has 2 voices, and was last updated by kimbomadsen 2 months ago. Log In Register Lost Password Author Posts May 15, 2019 at 16:42 #53991 David KeithParticipant Hi Kim! In trying to parse the JSON packet that comes back from this test URL: 014032%3D%7D013032%26%2C1000000000000XYZ12″>https://accessgudid.nlm.nih.gov/api/v2/devices/lookup.json?udi=%3D%2F08717648200274%3D%2C000025%3DA99971312345600%3D>014032%3D%7D013032%26%2C1000000000000XYZ123 …and using this source code to parse it: procedure TForm1.Button1Click(Sender: TObject); var json: TkbmMWJSONObject; stream: TkbmMWJSONStreamer; s: String; bytes: TkbmMWBytes; begin stream := TkbmMWJSONStreamer.Create; try s := http.Get(KURLNLMAccessGUDID + KUDISample); memo1.Text := s; SetLength(bytes,Length(AnsiString(s))); Move(s,bytes,Length(AnsiString(s))); json := TkbmMWJSONObject(stream.LoadFromUTF8String(bytes)); finally stream.Free; end; end; …I get the following error: Syntax error. Expected identifier. : Pos 2 : If I use the Delphi 10.3 Enterprise REST Debugger tool, the JSON packet is properly parsed, is reported as properly formed JSON, and is displayed as a pretty formatted JSON tree. Also, if I try to pass a UnicodeString to the stream.LoadFromUTF16String(s), I get an access violation in the call to kbmMWJSON.TkbmMWJSONStreamer.ExpectNumber, line# 720. kbmMW 5.06.20 Delphi 10.3 Enterprise May 15, 2019 at 18:59 #53992 kimbomadsenKeymaster Works fine in my tests. Something else must be happening. Try to open the ObjectNotation demo, and paste the JSON you have received in a browser, directly into the JSON parsing part, and let it parse. Here it works fine (using 5.09) best regards Kim/C4D May 15, 2019 at 20:06 #53993 David KeithParticipant I tried this with the objectNotation demo. I pasted in the JSON packet. I hit the ‘Parse’ button. I get an access violation. Delphi 10.3 Enterprise kbmMW 5.06.20 May 16, 2019 at 14:55 #53996 kimbomadsenKeymaster I suggest you to update to a later kbmMW version since it works fine in 5.09. best regards Kim/C4D Author Posts Log In Register Lost Password You must be logged in to reply to this topic.