Skip to content

Instantly share code, notes, and snippets.

@brunoborges
Created April 13, 2015 13:47
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 brunoborges/d8dbd07c3c4cf9bbaa2f to your computer and use it in GitHub Desktop.
Save brunoborges/d8dbd07c3c4cf9bbaa2f to your computer and use it in GitHub Desktop.
var ClientBuilder = Packages.javax.ws.rs.client.ClientBuilder;
var client = ClientBuilder.newClient();
var target = client.target("http://ip.jsontest.com/");
var response = JSON.parse(target.request().get(java.lang.String.class));
print("Your IP address is ${response.ip}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment