Manuais
PHC GO Funções SDK - JSON
 

JSON

This class contains functions that allow you to serialize and deserialize JSON strings.
 
 

toObject


Description

Deserializes the JSON string to an object.

Return Function

The deserialized object from the JSON string.

Parameters


Name Description Type
str The JSON to deserialize String

Example


Dim JSONclient as string = "{""name"":""Albertino Maciel"",""no"":1}"
Dim objResult = SDK.JSON.ToObject(Of Object)(JSONclient)
Return New MsgInfo("The user name is: " + objResult("name"))


toJSON


Description

Serializes a specified object to a JSON string.

Return Function

A JSON string representation of the object.

Parameters


Name Description Type
obj The object to serialize Object

Example


'Gets the customer list in JSON string 

Dim listOfCustomers as List(Of ClVO) = SDK.Query.getEntityData(of ClVO)()

Dim listOfCustomersJson as String = SDK.JSON.ToJSON(listOfCustomers)