Created
May 17, 2012 08:55
-
-
Save dotanh/2717520 to your computer and use it in GitHub Desktop.
RESTful client example using Apache Jersey: GET call
This file contains 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
String serverBootResponse = | |
service.path("machine/createMachine") | |
.queryParam("name", serverName) | |
.queryParam("imageId", imageId) | |
.accept(MediaType.APPLICATION_XML) | |
.cookie(cookie) | |
.get(String.class); | |
final DocumentBuilder documentBuilder = createDocumentBuilder(); | |
final Document doc = | |
documentBuilder.parse(new InputSource(new StringReader(serverBootResponse))); | |
final String status = xpath.evaluate("response/responseCode", doc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment