Android Question HTTP Response Status Code

Derek Jee

Active Member
Licensed User
Hello there

I am writing an app which talks to a web api written in VB and it receives data back. In some instances I want to return a different status code based on what I am looking for in a database. For instance I query my database for some data to download and see that it is no longer there and want to send a 410 gone.. In Vb I can send

B4X:
         response.StatusCode = 410
         response.StatusDescription = "Gone"
Which does send the message back to the app but it is not reflected in the job.tag (StatusCode in HTTPJob module) but just sends a HTML 410 page and an error in B4A. I really want the job.tag to tell me this status..

I hope this makes sense, if so can anyone advise..

Thank you,

Derek.
 

Derek Jee

Active Member
Licensed User
Thank you Erel..

I saw another response with the same advice and put it in place. Works a treat. Thank you :)

Derek.
 
Top