JSON

The JSON (JavaScript Object Notation) is a data-interchange format based on a subset of JavaScript. It provides an alternative to XML and is often used for serializing and transmitting structured data over a network connection, especially in web applications.

Uniface uses the JSON format for updating dynamic server pages using websave and webload.

JSON is widely used in web applications and web services. To enable Uniface applications to accept and generate JSON-formatted data, you can use the JsonToStruct and structToJson Proc commands.

JSON Data

Data in a JSON stream is defined as a JSON object or an array:

  • A JSON object begins and ends with braces {}, and contains a comma-delimited list of zero or more members, consisting of a name and value separated by a colon. A member can have a value that is an object or an array.

  • A JSON array begins and ends with square brackets [] and contains zero or more values separated by commas. A value can be an object or an array.

For example, the following JSON stream defines an object containing name-value members. The last member, Children, contains an array of values:

{
    "First Name" : "Barbara",
    "Last Name" :  "Singh",
    "Date of birth" :   { "year" : 1955, "month" : 1, "day" : 23 }, 
    "Children" :  ["Martin", "Margaret", "Mary"]
   }

For more information on JSON, see json.org