Example #1
0
  public RestfulResponse<JsonRepresentation> execute() {
    try {
      if (!args.isEmpty()) {
        clientRequestConfigurer.configureArgs(args);
      }
      final Response response = clientRequestConfigurer.getClientRequest().execute();

      // this is a bit hacky
      @SuppressWarnings("unchecked")
      final BaseClientResponse<String> restEasyResponse = (BaseClientResponse<String>) response;
      restEasyResponse.setReturnType(String.class);

      return RestfulResponse.ofT(response);
    } catch (final Exception ex) {
      throw new RuntimeException(ex);
    }
  }
Example #2
0
 void setHeader(final ClientRequestConfigurer clientRequestConfigurer, final X t) {
   clientRequestConfigurer.header(getName(), parser.asString(t));
 }