×

Building a hypermedia-driven RESTful Java microservice using Hypermedia as the Engine of Application State (HATEOAS)

Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare+
Duration

30 Minutes

level

Beginner

Rating

4.8

Review

13 Reviews

Enrolled

58 Enrolled

Learn how to build hypermedia-driven RESTful Java microservices using HATEOAS (Hypermedia as the Engine of Application State). Explore how to enhance RESTful services by including hypermedia links that guide the client to future actions, improving flexibility and scalability.

Add your review

At a Glance

You’ll explore how to use Hypermedia As The Engine Of Application State (HATEOAS) to drive your RESTful web service on Open Liberty.

You will learn how to use hypermedia to create a specific style of a response JSON, which has contents that you can use to navigate your REST service. You’ll build on top of a simple inventory REST service that you can develop with MicroProfile technologies. You can find the service at the following URL:
http://localhost:9080/inventory/hosts
The service responds with a JSON file that contains all of the registered hosts. Each host has a collection of HATEOAS links:
{
"foo": [
{
"href": "http://localhost:9080/inventory/hosts/foo",
"rel": "self"
}
],
"bar": [
{
"href": "http://localhost:9080/inventory/hosts/bar",
"rel": "self"
}
],
"*": [
{
"href": "http://localhost:9080/inventory/hosts/*",
"rel": "self"
}
]
}

What is HATEOAS?
HATEOAS is a constrained form of REST application architecture. With HATEOAS, the client receives information about the available resources from the REST application. The client does not need to be hardcoded to a fixed set of resources, and the application and client can evolve independently. In other words, the application tells the client where it can go and what it can access by providing it with a simple collection of links to other available resources.

Response JSON
In the context of HATEOAS, each resource must contain a link reference to itself, which is commonly referred to as self. In this guide, the JSON structure features a mapping between the hostname and its corresponding list of HATEOAS links:
 "*": [
{
"href": "http://localhost:9080/inventory/hosts/*",
"rel": "self"
}
]

Link types
The following example shows two different links. The first link has a self relationship with the resource object and is generated whenever you register a host. The link points to that host entry in the inventory:
 {
"href": "http://localhost:9080/inventory/hosts/<hostname>",
"rel": "self"
}
The second link has a properties relationship with the resource object and is generated if the host system service is running. The link points to the properties resource on the host:
 {
"href": "http://<hostname>:9080/system/properties",
"rel": "properties"
}

Other formats
Although you should stick to the previous format for the purpose of this guide, another common convention has the link as the value of the relationship:
 "_links": {
"self": "http://localhost:9080/inventory/hosts/<hostname>",
"properties": "http://<hostname>:9080/system/properties"
}

User Reviews

0.0 out of 5
0
0
0
0
0
Write a review

There are no reviews yet.

Be the first to review “Building a hypermedia-driven RESTful Java microservice using Hypermedia as the Engine of Application State (HATEOAS)”

Your email address will not be published. Required fields are marked *

Building a hypermedia-driven RESTful Java microservice using Hypermedia as the Engine of Application State (HATEOAS)
Building a hypermedia-driven RESTful Java microservice using Hypermedia as the Engine of Application State (HATEOAS)
Edcroma
Logo
Compare items
  • Total (0)
Compare
0
https://login.stikeselisabethmedan.ac.id/produtcs/
https://hakim.pa-bangil.go.id/
https://lowongan.mpi-indonesia.co.id/toto-slot/
https://cctv.sikkakab.go.id/
https://hakim.pa-bangil.go.id/products/
https://penerimaan.uinbanten.ac.id/
https://ssip.undar.ac.id/
https://putusan.pta-jakarta.go.id/
https://tekno88s.com/
https://majalah4dl.com/
https://nana16.shop/
https://thamuz12.shop/
https://dprd.sumbatimurkab.go.id/slot777/
https://dprd.sumbatimurkab.go.id/
https://cctv.sikkakab.go.id/slot-777/
https://hakim.pa-kuningan.go.id/
https://hakim.pa-kuningan.go.id/slot-gacor/
https://thamuz11.shop/
https://thamuz15.shop/
https://thamuz14.shop/
https://ppdb.smtimakassar.sch.id/
https://ppdb.smtimakassar.sch.id/slot-gacor/
slot777
slot dana
majalah4d
slot thailand
slot dana
rtp slot
toto slot
slot toto
toto4d
slot gacor
slot toto
toto slot
toto4d
slot gacor
tekno88
https://lowongan.mpi-indonesia.co.id/
https://thamuz13.shop/
https://www.alpha13.shop/
https://perpustakaan.smkpgri1mejayan.sch.id/
https://perpustakaan.smkpgri1mejayan.sch.id/toto-slot/
https://nana44.shop/
https://sadps.pa-negara.go.id/
https://sadps.pa-negara.go.id/slot-777/
https://peng.pn-baturaja.go.id/
https://portalkan.undar.ac.id/
https://portalkan.undar.ac.id/toto-slot/
https://penerimaan.ieu.ac.id/
https://sid.stikesbcm.ac.id/