org.apache.wink.client

Resource resource =
client
.resource(
"http://" + HOST_NAME + ":" + PORT + "/nodecollector/" + hypervisorIP + "/"
+ HOST_RESOURCE);

resource.header(HttpHeaders.CONTENT_TYPE, 'application/json');

resource.queryParam(HYPERVISOR_KEY, hypervisorType.getValue())
.queryParam(USER_KEY, user).queryParam(PASSWORD_KEY, password);

ClientResponse response = resource.accept(MediaType.APPLICATION_XML_TYPE).get();
HostDto host = response.getEntity(HostDto.class);

ref : http://www.programcreek.com/java-api-examples/index.php?api=org.apache.wink.client.ClientResponse

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s