In this article we will explore apche HttpClient API. It is one of the popular client is used to communicate with rest services.
Especially, in this article we are going to discuss following topics
- How to create HttpClient with SSL enabled : It is important, because without enabling SSL, we can’t communicate with Rest API which is deployed in https environment. (http protocol is disabled). The following code snippet, explains to create Http Client with SSL
- How to set authentication headers to HttpClient Next step is, set authentication headers to communicate rest api which has security. Check the following code
- How to download a file using HttpClient with SSL enabled
- httpclient-4.4.jar
- httpcore-4.4.jar
The following example demonstrates how write a simple HttpClient to download file from server using REST API call in secured environment
To compile and execute the following program we required below jar in build path.
Click here to Download jar files FileDownloadHttpClient.java

0 comments :
Post a Comment