How to retrieve header value in Android?
<p>I'm trying to send response using headers from Java web application to Android. I'm unable to read header value. </p>

<p>I'm passing header as:</p>

<p><code>response.setHeader("response", "ok");</code>
<code>response.setHeader("url", androidResponseBean.getUrl());</code></p>

<p>I tried using:</p>

<p><code>Header[] header = (Header[]) httpResponse.getAllHeaders();</code></p>

<p>I'm unable to iterate for retrieving header values. </p>

<p>This is my code which sends request to web application:</p>

<pre><code>DefaultHttpClient httpClient = new DefaultHttpClient();
            //HttpGet httpGet = new HttpGet(params[0]);
            HttpPost httpPost = new HttpPost(params[2]);

            ArrayList&lt;NameValuePair&gt; nameValuePair = new ArrayList&lt;NameValuePair&gt;();

            nameValuePair.add(new BasicNameValuePair("ssn", params[0]));
            nameValuePair.add(new BasicNameValuePair("dob",params[1]));

            httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair, "UTF-8"));
            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            response = EntityUtils.toString(httpEntity);
</code></pre>
