Android Question json response conflict


Licensed User

I am sending a http request , if the request returns false I need to display a msgbox. PRoblem is this is what i get from the logs :

JobName = order, Success = false
{"code":-2010,"msg":"Account has insufficient balance for requested action."}

In my code I am trying to display the msgbox when the job's error message which is: "Account has insufficient balance for requested action."

job.errormessage is not the json for the error message it is empty
when I try job.getstring at success=false section as below ,it is not also working. How can i grab that message to show in msgbox ?

If Job.JobName="order" Then
        If Job.Success = True Then
Dim parser As JSONParser
parser.Initialize(job.getstring)  ' I also tried job.errormessage here
Dim root As Map = parser.NextObject
Dim msg As String = root.Get("msg")
Dim code As Int = root.Get("code")

        End If
    End If


Licensed User
if the request returns false
Most likely, the returned information contains the "false" information, but yet still returns a HTTP response code of 200, which means Job.Success is true. HTTP response codes are usually not used for true/false returns. So most likely, even though you get a "false" return, you still have to process that in Job.Success portion of your code. The only time you get Job.Success = False if the HTTP response code is not 200 (
Upvote 0