Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boundaries-io/c732805762ec48178b88ddc3ce8f9203 to your computer and use it in GitHub Desktop.
Save boundaries-io/c732805762ec48178b88ddc3ce8f9203 to your computer and use it in GitHub Desktop.
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()));
@boundaries-io
Copy link
Author

sample java code to query boundaries-io endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment