[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: disable automatic reason phrase lookup
From:       Ken Hausam <kah_12831 () yahoo ! com>
Date:       2011-10-14 20:53:50
Message-ID: 1318625630.89501.YahooMailClassic () web161422 ! mail ! bf1 ! yahoo ! com
[Download RAW message or body]


Yes. Thank you for the reply. Just realized that this wasn't the problem. The problem \
is between the chair and keyboard. :)



--- On Fri, 10/14/11, Oleg Kalnichevski <olegk@apache.org> wrote:

From: Oleg Kalnichevski <olegk@apache.org>
Subject: Re: disable automatic reason phrase lookup
To: kah_12831@yahoo.com
Cc: httpclient-users@hc.apache.org
Date: Friday, October 14, 2011, 3:23 PM

On Fri, 2011-10-14 at 10:24 -0700, Ken Hausam wrote:
> I would like instructions on how to setup a custom reason phrase catalog. \
> Specifically, I would like to disable use of the reason phrase lookup catalog and \
> have the actual reason phrase returned from the server available to me via the API. \
>  I found some documentation on BasicHttpResponse constructor that says if I pass \
> null for the catalog parameter, I will disable automatic reason phrase lookup. \
> Problem is, I don't know how to construct my own HttpResponse. It is being \
> constructed for me by the DefaultHttpClient.execute() method. Also looked at the \
> DefaultHttpResponseFactory javadoc, but could not figure out how to register my own \
> factory. 
> Here is my relevant code. If someone could reply back with the code changes needed \
> to disable automatic use of the reason phrase catalog, I'd appreciate it. 
> HttpGet httpGet = new HttpGet("http://localhost:8080/myendpoint");
> HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet);
> HttpEntity responseEntity = httpResponse.getEntity();
> EntityUtils.consume(responseEntity);
> 
> StatusLine statusLine = httpResponse.getStatusLine();
> String reasonPhrase = statusLine.getReasonPhrase();
> 
> 
> Thanks,
> Ken

Ken

HttpClient returns all properties of the response status line _exactly_
as they were generated by the server. Please see code of BasicLineParser
in HttpCore and DefaultResponseParser in HttpClient in case you want to
double-check.

Oleg



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic