Q qsrtech Active Member Licensed User Longtime User Jan 22, 2014 #1 I'm finding I'm having an issue with Httputils. Seems to happen after 1000's of requests. Restarting the app seems to resolve it, unfortunately I have some widgets that run into this problem and they have to be completely re-installed, unless I wanna restart my device which I hate doing cause you never know if it will restart! (esp windows!)
I'm finding I'm having an issue with Httputils. Seems to happen after 1000's of requests. Restarting the app seems to resolve it, unfortunately I have some widgets that run into this problem and they have to be completely re-installed, unless I wanna restart my device which I hate doing cause you never know if it will restart! (esp windows!)
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #2 Are you using HttpUtils or HttpUtils2? Are you sending all of the requests at once?
Q qsrtech Active Member Licensed User Longtime User Jan 22, 2014 #3 2 and no they range from mins to 30 mins. Is there a way to "reset" the httputils like after a certain number of requests cause like I said once the app is restarted it's fine and other apps running (that use httputils as well) aren't affected. edit: other apps which use the same Web service as well aren't affected Last edited: Jan 22, 2014
2 and no they range from mins to 30 mins. Is there a way to "reset" the httputils like after a certain number of requests cause like I said once the app is restarted it's fine and other apps running (that use httputils as well) aren't affected. edit: other apps which use the same Web service as well aren't affected
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2014 #4 Are you calling Job.Release in JobDone? What is the error message?
Q qsrtech Active Member Licensed User Longtime User Jan 22, 2014 #5 Yes job.release. b4a doesn't get any specific error, just the result returns HTML stating " <BODY><h2>Bad Request - Request Too Long</h2> " and " <hr><p>HTTP Error 400. The size of the request headers is too long.</p>" among-st other basic html error stuff. I don't include any other header stuff than what is sent automatically and my post data is just a basic SQL storedprocedure call so less than 100 chars. EDIT: Miraculously my widget starting working again today. not sure if httputils reset itself somehow. I'm going to change to using a GET and see if it happens again. It will take several days to weeks to determine if that's the cause, assuming my phone doesn't get restarted. Last edited: Jan 22, 2014
Yes job.release. b4a doesn't get any specific error, just the result returns HTML stating " <BODY><h2>Bad Request - Request Too Long</h2> " and " <hr><p>HTTP Error 400. The size of the request headers is too long.</p>" among-st other basic html error stuff. I don't include any other header stuff than what is sent automatically and my post data is just a basic SQL storedprocedure call so less than 100 chars. EDIT: Miraculously my widget starting working again today. not sure if httputils reset itself somehow. I'm going to change to using a GET and see if it happens again. It will take several days to weeks to determine if that's the cause, assuming my phone doesn't get restarted.
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2014 #6 It might be related to an endless list of cookies. You can try to call StopService(HttpUtils2Service) and then start it again. It will create a new HttpClient.
It might be related to an endless list of cookies. You can try to call StopService(HttpUtils2Service) and then start it again. It will create a new HttpClient.
Q qsrtech Active Member Licensed User Longtime User Jan 23, 2014 #7 Erel said: It might be related to an endless list of cookies. You can try to call StopService(HttpUtils2Service) and then start it again. It will create a new HttpClient. Click to expand... Thanks. Now that I learned how to do a GET I'm switching everything to Get except one call that can and does go over the GET length limitations. I skipped over the download2 method cause it's somewhat misleading, also your original SQL tutorial used poststring. I'll also incorporate a daily "cleanse" by restarting the httputils service as a precaution. On a side note it does seem like GET's are faster, at least in my cases. Last edited: Jan 23, 2014
Erel said: It might be related to an endless list of cookies. You can try to call StopService(HttpUtils2Service) and then start it again. It will create a new HttpClient. Click to expand... Thanks. Now that I learned how to do a GET I'm switching everything to Get except one call that can and does go over the GET length limitations. I skipped over the download2 method cause it's somewhat misleading, also your original SQL tutorial used poststring. I'll also incorporate a daily "cleanse" by restarting the httputils service as a precaution. On a side note it does seem like GET's are faster, at least in my cases.
Q qsrtech Active Member Licensed User Longtime User Jan 25, 2014 #8 UPDATE: Unfortunately switching to GET did not seem to resolve the issue. Same HTTP error code. Last option is to try and "cleanse" by stopping/restarting the httputilsservice everyday.
UPDATE: Unfortunately switching to GET did not seem to resolve the issue. Same HTTP error code. Last option is to try and "cleanse" by stopping/restarting the httputilsservice everyday.
Q qsrtech Active Member Licensed User Longtime User Jan 26, 2014 #9 Do you think it could have something to do with the server's timeouts? Maybe the timeouts are too high and the app's connection is never "recycled" so it just keeps compounding?
Do you think it could have something to do with the server's timeouts? Maybe the timeouts are too high and the app's connection is never "recycled" so it just keeps compounding?
warwound Expert Licensed User Longtime User Jan 26, 2014 #10 Do you have access to the server? If so then could you write some code to log the request headers to a file when there is an error. Then you could take a look at that file to see exactly what these 'too long' request headers are. Martin.
Do you have access to the server? If so then could you write some code to log the request headers to a file when there is an error. Then you could take a look at that file to see exactly what these 'too long' request headers are. Martin.
Erel B4X founder Staff member Licensed User Longtime User Jan 26, 2014 #11 I don't think that it is related to timeouts.