Code example for BasicHttpResponse

Methods: setReasonPhrase

0
    */ 
   private void execute(HttpClient client, HttpRequestBase method) {
      Log.d(CLASSTAG, " " + HTTPRequestHelper.CLASSTAG + " execute invoked");
 
      // create a response specifically for errors (in case) 
      BasicHttpResponse errorResponse = new BasicHttpResponse(new ProtocolVersion("HTTP_ERROR", 1, 1), 500, "ERROR");
 
      try { 
         client.execute(method, this.responseHandler);
         Log.d(CLASSTAG, " " + HTTPRequestHelper.CLASSTAG + " request completed");
      } catch (Exception e) {
         Log.e(CLASSTAG, " " + HTTPRequestHelper.CLASSTAG, e);
         errorResponse.setReasonPhrase(e.getMessage());
         try { 
            this.responseHandler.handleResponse(errorResponse);
         } catch (Exception ex) {
            Log.e(CLASSTAG, " " + HTTPRequestHelper.CLASSTAG, ex);
         } 
      } 
   }