I have coded a REST webservice client, that interacts with a service that provides JSON-formatted resources. While my code is working fine, I would like to further decouple it from the actual REST-API structure in the way that HATEOAS is generally meant to be done.
I should add that I am using Jersey 2 for the interaction with the webservice, and thus a general resource-query against the service would like as follows:
Now, the next step is usually to request and read the resource at the targeted location as such
Or alternatively, to process the returned data (and this is the way I have consistently done it in my code thus far):
However.... I am positive that other than that kind of processing, I should also be able to "traverse" the webservice application by means of the links contained in the response.
It should work like this:
.. However this does not work. This is despite that I can confirm that the resource has links in it.
The returned resource has the following JSON format:
As you can see there are clearly some links in the returned resource, and yet, a call to getLinks() consistently returns an empty Set<Link>.
Does anyone know how to configure Jersey to successfully let me extract link URI's this way from a Response object?
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter