Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6D161200B4A for ; Wed, 20 Jul 2016 17:05:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6B44A160A64; Wed, 20 Jul 2016 15:05:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B41FB160A5B for ; Wed, 20 Jul 2016 17:05:21 +0200 (CEST) Received: (qmail 52659 invoked by uid 500); 20 Jul 2016 15:05:20 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 52648 invoked by uid 99); 20 Jul 2016 15:05:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2016 15:05:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7F2B32C0278 for ; Wed, 20 Jul 2016 15:05:20 +0000 (UTC) Date: Wed, 20 Jul 2016 15:05:20 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1757) Make request available to ResponseHandlers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 20 Jul 2016 15:05:22 -0000 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15385997#comment-15385997 ] Oleg Kalnichevski commented on HTTPCLIENT-1757: ----------------------------------------------- bq. Is there an attribute of the HttpContext that provides the current Yes, there is. Oleg > Make request available to ResponseHandlers > ------------------------------------------ > > Key: HTTPCLIENT-1757 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1757 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient > Affects Versions: 4.5.2 > Reporter: Tobias Oberlies > Fix For: 5.0 Alpha2 > > > We use HttpClients for a system test of a REST API. We are using ResponseHandlers to directly convert the response entity to a data structure that is suitable for assertions. > This works very well, except for the occasional case where the system under test responds with an unexpected status code. In this case, the response handler throws an exception. For a good error message, it would be useful to also include the request URL. However the request object is not available in the ResponseHandler.handleResponse method. > So this is a request to also make the HttpRequest object available in the ResponseHandler.handleResponse method. This could be done by adding a getter in the HttpResponse class, or by creating a new interface (e.g. HttpResponseHandler2) with a two-parameter handleResponse method. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org