Standardizing a Primitive Result

When receiving a primitive result from a REST service, you don’t need to deserialize it.

The JSON and XML formats are used to serialize an object into a text representation, but primitive types already have a reasonable text representation. That said, it is common for REST services to put some amount of markup around a primitive type response or surround the result with quote characters.

You can use the JadeRestResponse class getDataWithoutMarkup method to remove any markup or quotes from a response body, leaving only the primitive type result. The method will always return a String. If the primitive is a different type, you will need to type‑cast it to the appropriate type; for example:

intResult := jadeRestResponse.getDataWithoutMarkup().Integer;