I am working with a server whose response is used in JSON format.
when the request contains valid data, they respond with a string like this
{"data": {"Results": [{"Branch": "ACCT590006"}]}}
but if the request parameters are incorrect, the answer will look like this
{"error": {"error": [{"Domain": "global", "reason": "invalid", "message": "Invalid Params"}], "code": 98865, "message": " Invalid parameter value "}}
So, questions arise, how can I determine when the server response contains an error string using an object TJSONObjectand further analyze JSON to display messages and error codes like this.
Failed reason : invalid
Message : Invalid params
Code: 98865
message : invalid param value.
source
share