User Tools

Site Tools


jsondataclass_overview.htm
Navigation:  ABC Library Reference > JSON Data Class >JSONDataClass Overview Previous pageReturn to chapter overviewNext page

The JSON class provides an easy way to work with JSON data.  It provides methods to move data to and from Clarion data structures; QUEUE, GROUP, STRING and arrays (DIMfields).

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write, and easy for computer languages to parse and generate. JSON is an easier to use alternative to XML. JSON can be fetched or uploaded with an HttpWebRequest.

JSON Syntax Rules

Data is placed in name/value pairs, and separated by commas. Curly braces hold objects and Square brackets hold arrays.

JSON Data

A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value:

“FirstName” : “Betsy”

The “name” side is (the equivalent of a field name) “firstName” and the value side in this case is “Betsy”.

Example with multiple records:

[{“Name” : “Apples”, “ProductID” : 101, “QtyOnHand” : 60},“Name” : “Oranges”, “ProductID” : 102, “QtyOnHand” : 70},“Name” : “Pears”, “ProductID” : 103, “QtyOnHand” : 50}]

The JSONDataClass handles all the reading and writing for JSON data.

jsondataclass_overview.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1