uniba-dsg/betsy

Replace unirest with a library that understands semantic versioning

lenhard opened this issue · 4 comments

Currently we use unirest for communicating JSON over HTTP. However, unirest fails to use semantic versioning (although their version numbers create the impression that they do). They implement API changes for patch version updates which tends to break the build when modifying something unrelated. This has happend twice already and is really annoying.

We should switch to a proper HTTP library.

Using another REST API is not easy, as the different bpmn engines use different authentication mechanisms that caused a lot of issues with the apache commons http client. We should just fix the unirest version.

Given all the hype, I find it hard to believe that there is no easy-to-use and mature REST API for Java out there.

Anyway, this is no critical issue. I just think we should keep our eyes open and look anew the next time we modify the REST code.

For documentary purposes:

First, I used Java plain and simple. However, this caused a lot of problems as I wanted to use basic authentication, as well as transmitting files as part of a multi-part http post request. I did not manage to get this implemented manually.

Then, I tried http components by http://hc.apache.org/, however, there were issues with authentication as well. As I had unirest working very nicely, as well as having the nice API that can be seen in JSONHelper, I stopped tinkering with it. This may be a starting point.

Has been stable for 9 months -> close.