Created
July 13, 2016 01:47
-
-
Save VanitySoft/032a45eb39741606960575f7e38d606b to your computer and use it in GitHub Desktop.
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( | |
"https://vanitysoft-boundaries-io-v1.p.mashape.com/reaperfire/rest/v1/public/boundary?and=true&state=TX"); | |
httpGet.setHeader("X-Mashape-Key", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); | |
httpGet.setHeader("Accept", "application/json"); | |
CloseableHttpResponse response = httpclient.execute(httpGet); | |
Assert.assertTrue(Integer.toString(response.getStatusLine().getStatusCode()), | |
response.getStatusLine().getStatusCode() == 200); | |
FileUtils.writeByteArrayToFile(new File("TX-production-Httpclient.json"), | |
IOUtils.toByteArray(response.getEntity().getContent())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment