urlConnection.getInputStream() throwing EOFException
<p>I am executing the following code and always get an EOFException in urlConnection.getInputStream().  I know that the webserver is not returning proper headers, but if I use the same url in a web browser I get the expected content back.</p>

<pre><code>URL url1;
try
{
    url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
    HttpURLConnection urlConnection = (HttpURLConnection) url1.openConnection();
    try 
    {
        InputStream in = new BufferedInputStream(urlConnection.getInputStream());
        readStream(in);
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    finally
    {
        urlConnection.disconnect();
    }
}
catch (MalformedURLException e)
{
    e.printStackTrace();
}
catch (IOException e)
{
    e.printStackTrace();
}
</code></pre>

<p>Any ideas?</p>

<p><strong>Edit 1:</strong></p>

<p>I thought I was on to a possible solution.  I found that using Android 2.3 I can read the response by calling getHeaderFields() (even though there is no header), but if I use Android 4.1 getHeaderFields() returns null.  Any ideas?</p>

<pre><code>url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
URLConnection urlConnection = url1.openConnection();
Map&lt;String, List&lt;String&gt;&gt; fields = urlConnection.getHeaderFields();
</code></pre>
