/** * Calls the API with the given parameters and returns a response. * * @param url API url to call * @param queryParams A String array with the query parameters * @param headers A String Array with the headers * @return The response of the service call */ private WS.Response callApi( final String url, final String[] queryParams, final String[] headers) { WSRequestHolder result = WS.url(SERVER_URL + url); if (queryParams != null) for (int i = 0; i + 1 < queryParams.length; i += 2) { result.setQueryParameter(queryParams[i], queryParams[i + 1]); } if (headers != null) for (int i = 0; i + 1 < headers.length; i += 2) { result.setHeader(headers[i], headers[i + 1]); } return result.get().get(10000); }