menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

When to Us...
source image

Javacodegeeks

1M

read

145

img
dot

Image Credit: Javacodegeeks

When to Use Affordance vs. Link in Hypermedia Controls

  • Spring HATEOAS introduces the concepts of Link and Affordance in REST APIs for enriching API responses with navigable metadata.
  • A Link represents a navigable hyperlink, while an Affordance describes possible actions at a linked URI, including HTTP operations and input metadata.
  • Links are used for navigation to another resource or read-only endpoints, while Affordances are used when client interaction and action descriptions are required.
  • Best practices include starting with Links for navigation, adding Affordances when needed for client interaction, and being intentional with defining relationship types.

Read Full Article

like

8 Likes

For uninterrupted reading, download the app