D Derek Jee Active Member Licensed User Longtime User Jun 27, 2015 #1 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 Code: Copy 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.
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 Code: Copy 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.
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2015 #2 Use HttpUtils2 source code instead of the library and add these two lines to hc_ResponseSuccess: Code: Copy Dim job As HttpJob = TaskIdToJob.Get(TaskId) job.Tag = Response.StatusCode Upvote 0
Use HttpUtils2 source code instead of the library and add these two lines to hc_ResponseSuccess: Code: Copy Dim job As HttpJob = TaskIdToJob.Get(TaskId) job.Tag = Response.StatusCode
D Derek Jee Active Member Licensed User Longtime User Jun 28, 2015 #3 Thank you Erel.. I saw another response with the same advice and put it in place. Works a treat. Thank you Derek. Upvote 0
Thank you Erel.. I saw another response with the same advice and put it in place. Works a treat. Thank you Derek.