I wrote a code to parse and manipulate some data in a 3rd party website using jsoup.
The website reponses HTTP 401 if user is not logged in and shows login form. Since JSoup throws exceptions in these cases(Http response is not 2xx or 3xx) i used ignoreHttpErrors(true)
in my connection.
The odd part is when i test the android application that uses that code it works fine on android ICS, Kitkat and lollipop but when i test it in android 2.3.7 on emulator the following code throws IOException with "Received authentication challenge is null" message.
Jsoup.connect(address)
.method(Connection.Method.GET)
.ignoreHttpErrors(true)
.timeout(30 * 1000)
.execute()
and the as i mentioned ignoreHttpErrors
doesn't help. What is different between these versions?! (I am trying to run it on android 3.x too) Is this something about JSoup or android? Is there a workaround to have compatibility with android 2.x?