Skip to content Skip to sidebar Skip to footer

Java.net.protocolexception With Httpsurlconnection In Android

I am trying to create a FlickR request through HttpURL connection and I get a java.net.protocolException on con.getInputStream() Thread thread = new Thread(new Runnable(){

Solution 1:

<!DOCTYPE htmlPUBLIC"-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html; charset=utf-8"><title>ERROR: Cache Access Denied</title><styletype="text/css"><!--   /* Page basics */

You are getting html instead of xml, the reason you are getting an exception. Check your Url.

Solution 2:

The server is kindly failing to return a correctly formed HTTP response. Instead it is just returning straight HTML, no HTTP headers. Nothing you can do about it at the client end. Complain to the server people. If that's you, fix it.

BTW Nothing to do with HTTPS or SSL, which is working perfectly,

Post a Comment for "Java.net.protocolexception With Httpsurlconnection In Android"