Skip to content

Instantly share code, notes, and snippets.

@bveliqi
Created January 11, 2014 00:40
Show Gist options
  • Save bveliqi/8365422 to your computer and use it in GitHub Desktop.
Save bveliqi/8365422 to your computer and use it in GitHub Desktop.
RESTEasy JAX-RS 2.0 Client
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