hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How to get the parameters from HttpRequest?
Date Fri, 19 Dec 2014 13:47:11 GMT
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


Mime
View raw message