Created
January 11, 2014 00:40
-
-
Save bveliqi/8365422 to your computer and use it in GitHub Desktop.
RESTEasy JAX-RS 2.0 Client
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
ResteasyClient client = new ResteasyClientBuilder().build(); | |
ResteasyWebTarget target = client.target(serviceRootUrl); | |
target = target.path("places") | |
.queryParam("client_id", authKey) | |
.queryParam("search[query]", cityName) | |
.queryParam("search[start_date]", fromDate) | |
.queryParam("search[end_date]", toDate) | |
.queryParam("search[price_min]", priceMin) | |
.queryParam("search[price_max]", priceMax) | |
.queryParam("search[number_of_beds]", numberOfGuests) | |
.queryParam("search[sort_by]", "top_ranking") | |
// todo: erstes oder zweites? | |
.queryParam("search[page]", this.currentPage) | |
.queryParam("page", this.currentPage) | |
.queryParam("language", "de") | |
.queryParam("search[per_page]", 100); | |
Response response = target.request().get(); | |
String result = response.readEntity(String.class); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment