Exemplo n.º 1
0
  public Response sendRequest(Method method, String url, Representation representation) {
    this.logger.debug("Method: " + method.getName() + " url: " + url);

    Request request = new Request();
    request.setResourceRef(url);
    request.setMethod(method);

    if (!Method.GET.equals(method) && !Method.DELETE.equals(method)) {
      request.setEntity(representation);
    }

    request.setChallengeResponse(this.challenge);

    return this.restClient.handle(request);
  }