public String request(Link link, String acceptedMediaType, ServiceParameter... serviceParameters) throws MalformedURLException, HttpClientException, SocketTimeoutException, OpenShiftException, UnsupportedEncodingException { String save = client.getAcceptedMediaType(); client.setAcceptedMediaType(acceptedMediaType); HttpMethod httpMethod = link.getHttpMethod(); URL url = getUrl(link.getHref()); Map<String, Object> parameters = toMap(serviceParameters); LOGGER.trace("Requesting {} on {}", httpMethod.name(), url); LOGGER.info("Requesting {} on {}", httpMethod.name(), url); String response = client.get(url); client.setAcceptedMediaType(save); return response; }
public RestResponse request(Link link, Map<String, Object> parameters) throws OpenShiftException { validateParameters(parameters, link); HttpMethod httpMethod = link.getHttpMethod(); String response = request(link.getHref(), httpMethod, parameters); return ResourceDTOFactory.get(response); }