How do I add query string to HttpMethod?

To send query string information in HTTP GET command you either using passing a simple string or an array of NameValuePair object into the HttpMethod‘s setQueryString() method. We also need to encode the parameter values before passing it to the method.

How do I setting a proxy for HttpClient?

In this example you’ll see how to configure proxy information for the HttpClient.

How do I perform HTTP GET method?

Below is an example using Commons HttpClient library to retrieve information from a website using HTTP GET method. The response will be returned as string by the HttpMethod.getResponseBodyAsString() method.