company logo

Values, formats and encoding

values - Values may be returned as result of a GET request or passed as data via a POST, PUT or PATCH request. Values represents either a single value, an object or a value array:.

values := value | object | array

object := '{' named_value [ named_value_ext(*) ] '}'

named_value_ext := ',' named_value

named_value := name ':' value

array := '[' value [ value_ext(*) ] ']'

value_ext := ',' value

value := string_value | number | 'true' | 'false' | 'null'

string_value := '"' string '"'

name - A name consists of ASCII characters (lower and upper case letters, digits, underscore). Typically, names appear as property names or field names in result definitions or body data.

number - A number is an integer, decimal or a float point number. It depends on context (property definition), which number types are allowed.

null - may be passed or returned for MEMO and BLOB properties and indicates no-data, which is slightly different from an empty string (""). null is also passed in order to indicate, that a property should be reset.

true, false - are the only values allowed for Boolean properties.

string - String values must not contain special characters as newline or tab. Special characters have to be escaped as follows (see also JSON syntax ):

  • \ ==> \\
  • line feed (10) ==> \n
  • carriage return (13) ==> \r
  • backspace (8) ==> \b
  • form feed (12) ==> \f
  • tab (9) == \t
  • " ==> \"

All string values exchanged via OHTTP are UTF8 encoded. Binary data ( BLOB properties) is always passed as BASE64 string (which is UTF8 compatible),

// POST, PUT, PATCH data block

{ name: "Müller", age: 45, comment: "Höhen und \nTiefen"

  image: "......" }

// JSON result instance

{ name: "Müller", age: 45, comment: "\Höhen und \nTiefen",

  image: "......" }