Added 

Headers h = he.getResponseHeaders();
      h.add("Content-type", "text/html"); 

To the code