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 <[email protected]> wrote: From: Oleg Kalnichevski <[email protected]> Subject: Re: disable automatic reason phrase lookup To: [email protected] Cc: [email protected] 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
