hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Motes <davidmo...@gmail.com>
Subject Re: unable to get header information from the response
Date Fri, 02 Jul 2010 13:25:34 GMT
Here is code that I use from 3.1 and it works..

It is looking for a test header called X-TEST-Premise, while looping
through the response headers.


        Header[] responseHeaders = method.getResponseHeaders();
        boolean bHitPremise = false;
        for (int i=0; i<responseHeaders.length; i++){
        	String tempString = responseHeaders[i].getName();
        	
        	if ( tempString.equals( "X-TEST-Premise" ) )
        	{
                        bHitPremise = true;
        		tempString = responseHeaders[i].getValue();
        		if ( !tempString.equals( "FolderList" ) )
        		{
        			isCorrect = false;
        		}
        	}
        	
            //System.out.print(responseHeaders[i]);
        }

On Fri, Jul 2, 2010 at 5:08 AM, dushyant masta <dushyant.masta@gmail.com> wrote:
>
> Some time the headers are received but sometimes not.
> I am using version - commons-httpclient-3.1.
>  i am using the code like
>
> Header[] headers = method.getResponseHeaders("abc");
> .....
> Thanks,
> Dushyant
>
> dushyant masta wrote:
>>
>>
>>
>>
>>
>> Sam Crawford wrote:
>>>
>>> What version are you using?
>>>
>>> Can you enable header logging, as per the documentation? See
>>> http://hc.apache.org/httpcomponents-client-4.0.1/logging.html for v4.0
>>>
>>> Thanks,
>>>
>>> Sam
>>>
>>>
>>> On 1 July 2010 13:27, dushyant masta <dushyant.masta@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am sending a request to the sample.aspx page where the server adds
>>>> some
>>>> string and header information in the response . when i fetch the
>>>> response ,
>>>> i am able to get the response in the string but unable to get the header
>>>> part. can ;someone tell me whats going wrong?
>>>>
>>>> thanks,
>>>> Dushyant kumar masta
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29045063.html
>>>> Sent from the HttpClient-User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/unable-to-get-header-information-from-the-response-tp29045063p29053902.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message