i recently suggested a possible solution to a similar problem:
https://www.b4x.com/android/forum/threads/okhttputils2-hard-refresh.144152/#post-914786
post #6
my suggestion worked in that case. you may wish to try it.
first you say the old data is displayed with okhttputils, then you say the new data is available 30 minutes
later. which is it? please explain what you are doing: you wait 30 minutes and then try again?
or you do other things (like watch some world cup on tv) and then, somehow, 30 minutes later, the new
data appears by itself? 30 minutes, not 25? not 20?
if cookies are the problem (that is, the server expects one), it is possible to capture the server's response
headers (including cookies) with okhttp. they are captured in a list:
list = job.response.getheaders.get("set-cookie"). note: your server may use "Set-Cookie", not "set-cookie".
case is important in this instance. the cookie list will be null if you use the wrong one...
once you have the cookies, you can simply return them with your next query as a request header.