コード例 #1
0
ファイル: RestfulRequest.java プロジェクト: adamhoward/isis
  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);
    }
  }
コード例 #2
0
ファイル: RestfulRequest.java プロジェクト: adamhoward/isis
 void setHeader(final ClientRequestConfigurer clientRequestConfigurer, final X t) {
   clientRequestConfigurer.header(getName(), parser.asString(t));
 }