Skip to content Skip to sidebar Skip to footer

Https Post In Android 4.0

I am testing a https post on android , I have 2 android devices, this code perfectly worked on my 2.3 device but will be blocked in my 4.1 device at 'retcode=urlCon.getResponseCode

Solution 1:

I suppose you have the Internet permission inside the manifest?I think that the problem is in the "User-Agent" inside one of the setRequestProperty or maybe in another one, but not in the rest of the code.

Solution 2:

Try putting

System.setProperty("http.keepAlive", "false");

somewhere in your code.

Post a Comment for "Https Post In Android 4.0"