Slide 17
Slide 17 text
출처) https://m.blog.naver.com/tmondev/220391644590
HyperMedia Representation
HyperMedia ?
HATEOAS(Hypermedia As The Engine Of Application State)라는 개념을 통해 해당 Resource에 대해 호출 가능한
API에 대한 정보를 Resource의 상태를 반영하여 표현
{
“accountId”:12345,
“accountType”:”saving”,
“balance”:350000”,
“currency”:”KRW”
}
{
“accountId”:12345,
“accountType”:”saving”,
“balance”:350000”,
“currency”:”KRW”
“links”: [
{
“rel”: “self”
“href”: “http://localhost:8080/accounts/1”
},
{
“rel”: “withdraw”,
“href”: “http://localhost:8080/accounts/1/withdraw”
},
{
“rel”:”transfer”,
“href”:”http://localhost:8080/accounts/1/transfer”
}
]
}
전형적인 REST API의 응답 데이터 HATEAOS가 도입되어 자원에 대한 추가 정보가 제공되는 응답 데이터
해당 Resource의 상태에 따라 접근 가능한 추가 API들이 “links”라는 이름으로 제공