Android Question http and okhttp problem

panagiotisden2

Active Member
Licensed User
Longtime User
hello, i have an app where i communicate with a website via http jobs.
the app works great with http and httputils2. if i switch to okhttp and okhttputils2 a download request does not return the content i want.
i use multiple jobs(one to login to the website, one to load content etc) the login part works and i get the results but other jobs cant give me the correct content. i suspect the cookies because i use eg. job1 to login end job2 to do something else and it may fail because it cant get the cookies loaded from job1.

any help here?
what is the deference between http and okhttp that may make it to fail?
thanks
 

panagiotisden2

Active Member
Licensed User
Longtime User
HTML:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <div id="container">
        <button id="leave_test" onclick="window.location='/'; return false;">return</button>
        <p style="font-size: 150%; font-weight: bold; text-align: center; position: absolute; top: 4em; left: 25%">no more questions for this test</p>
    </div>
</body>
</html>


i was only getting this content when a timeout occurred (user inactive for more than 30 minutes) now i get it immediately.

note:
"http://domain.gr/site/ajax/tool.category.select.php" -this returns correct (its a download request)
"http://domain.gr/site/ajax/tool.category.questions.php" -this too (its a post request)
"http://domain.gr/gr/student/login" -login is successful and i get the correct data (its a post request)
"http://domain.gr/gr/student/test/1" -this returns correct too and i get the content after login (its a download request)
"http://www.domain.gr/test.php" -this fails i get the above error (its a post request)
 
Last edited:
Upvote 0

panagiotisden2

Active Member
Licensed User
Longtime User
i already have android.jar v21 so that wont be a problem

ok i will stick to http for now, and i will find some time to investigate it more later.

thanks for the info
 
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…