Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B48EC9A69 for ; Fri, 19 Dec 2014 13:47:17 +0000 (UTC) Received: (qmail 71342 invoked by uid 500); 19 Dec 2014 13:47:17 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 71298 invoked by uid 500); 19 Dec 2014 13:47:17 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 71287 invoked by uid 99); 19 Dec 2014 13:47:17 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Dec 2014 13:47:17 +0000 Received: from ubuntu.local (27-172.192-178.cust.bluewin.ch [178.192.172.27]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 505F91A0233 for ; Fri, 19 Dec 2014 13:47:15 +0000 (UTC) Message-ID: <1418996831.21015.5.camel@apache.org> Subject: Re: How to get the parameters from HttpRequest? From: Oleg Kalnichevski To: HttpClient User Discussion Date: Fri, 19 Dec 2014 14:47:11 +0100 In-Reply-To: <549307DE.4090604@gmail.com> References: <549307DE.4090604@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit On Thu, 2014-12-18 at 17:59 +0100, Johan Hertz wrote: > Hi, > > I am creating a class that implements the interface HttpRequestHandler. > The handle method has a parameter of type HttpRequest on which I would > expect to find the payload/parameters sent to the server. It does have a > getParams method but it is deprecated. The deprecated message is /"use > configuration classes provided 'org.apache.http.config' and > 'org.apache.http.client.config//"/. > > Looking at this classes I can't seem to find what I am after, anyone > know where I should look? > > Regards > Johan > Johan URIBuilder [1] and URLEncodedUtils [2] from HttpClient should do the trick. You can use URIBuilder to manipulate request URIs and extract request query parameters. URLEncodedUtils can be used to parse request entity to extract form parameters. Hope this helps. Oleg [1] http://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/client/utils/URIBuilder.html [2] http://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/client/utils/URLEncodedUtils.html --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org