Last active
          June 26, 2018 16:09 
        
      - 
      
- 
        Save mindcrime/694e45ec673b17a1a576e1df4d8d5f46 to your computer and use it in GitHub Desktop. 
    Sample use of HTTP GET with Commons HttpClient
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | CloseableHttpClient httpclient = HttpClients.createDefault(); | |
| HttpGet httpget = new HttpGet("http://localhost/"); | |
| CloseableHttpResponse response = httpclient.execute(httpget); | |
| try | |
| { | |
| <...> | |
| } | |
| finally | |
| { | |
| response.close(); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment