you should check any 'hello world' example for HttpClient: http://hc.apache.org/httpcomponents-client-ga/examples.html