Search code examples
javascriptjsonspring-hateoashateoasopenproject

How to request and get value from HATEOAS


I am newbie to using hypermedia rest API (on openproject).

I retrieved from HATEOAS (Hypermedia As The Engine Of Application State) with javascript and show the result to HTML but not known how.

Example for my api url:

http://<my_domain>/target/api/v3/projects/design/work_packages

I have followed https://www.chillyfacts.com/javascript-send-http-getpost-request-read-json-response but javascript only work for JSON, can't work for "HAL + JSON"

==> My Question:

  1. Can javascript work with HATEOAS?

    • (If have) Which libraries on javascript to use?

    • (if not) Which programming language work with hal+json?

  2. Which programming language for design HATEOAS on the server-side?

< This is my api in openproject >

Thanks!


Solution

  • I already have the answer! I have used angular2 programming language with the Typescript (https://angular.io) and saw:

    1. Very easy to render data from the Typescript (process the logic) to HTML
    2. The library for work with the HATEOAS API is the "ketting" (https://github.com/badgateway/ketting/wiki/Getting-Started)

    ==> So, this topic was resolved!