Search code examples
javaapiopenrefine

OpenRefine's API: Unexpected response: HTTP/1.1 200 ok


I am writing a Java program to use OpenRefine without directly using the web page. To do so, I am using Refine-Java API: https://github.com/dtap-gmbh/refine-java

The connection is successful, as I can get the version of the installed OpenRefine through GetVersionResponse versionResponse = RefineCommands.getVersion().build().execute(client);

However, when I try to create a project through : CreateProjectResponse createProjectResponse = RefineCommands.createProject().file(new File("src/test/java/resources/test-1.csv")).name("testOpenExample").format(UploadFormat.SEPARATOR_BASED).options(() -> options).build().execute(client);

I get the following error message: Unexpected response : HTTP/1.1 200 OK and then nothing happens. This is surprising, as I can even see the command POST /command/core/create-project-from-upload (132ms) throw when createProjectResponse is executed.

When I go check the "Open Project" page, no project has been created. I am using OpenRefine 3.3


Solution

  • The issue was the version of OpenRefine. I changed to v2.8 and everything is working now.