HttpResponse response = restClient.execute(request, config.getAccessToken(),
HttpURLConnection.HTTP_BAD_REQUEST,
HttpURLConnection.HTTP_NOT_FOUND);
if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
throw new BadRequestException("The Application, Procedure and method exist, " +
"but the arguments are not as expected: " + GSON.toJson(parameters));
} else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
throw new NotFoundException("application or procedure or method", appId + "/" + procedureId + "/" + methodId);
}
return new String(response.getResponseBody(), Charsets.UTF_8);