Page History
...
The following example builds upon the example from the previous section. Notice that we know declare a component of type XPRIM_ErrorInfo, and pass it when we call the SetSourceHttpResponse method. We then check the OK property of the error info object to check if the JSON reader successfully reads the HTTP response body (which indicates that response is a well-formed JSON string)
Define_Com Class(#XPRIM_HttpRequest) Name(#Req) Define_Com Class(#XPRIM_RandomAccessJsonReader) Name(#Reader) Define_Com Class(#XPRIM_ErrorInfo) Name(#ErrorInfo) ... #Req.DoGet Url('https://maps.googleapis.com/maps/api/geocode/json?...') * Check if request is successful If (#Req.Response.IsSuccessHttpStatusCode)
...
* Set the JSON reader source fot response from the HTTP request
...
#Reader.SetSourceHttpResponse HttpResponse(#Req.Response) ErrorInfo(#ErrorInfo)
...
If (#ErrorInfo.OK)
...
* Read JSON values
...
. . .