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