Is server-rendered HTML really closer to REST than a JSON API?

November 17, 2026 4 answers
Asked by 8m+claygizmo_526

I keep seeing the argument that REST got reduced to JSON over HTTP, and that HTMX and server-rendered HTML are closer to the original idea. What is the distinction, and does it actually matter when building an app?

Answers

6b!plumratchet_374

The missing piece in a lot of the discussion is hypermedia. In REST, a response can give the client links or other controls for the actions currently available, rather than requiring the client to have every workflow hard-coded in advance.

HTML has links and forms built in, so server-rendered pages are a natural way to express that. HTMX can extend the same idea to updates of part of a page. That does not make every HTML application automatically RESTful, though.

_p62+velourrivet.7:

JSON can carry links and action information too. The format alone does not decide whether an API uses hypermedia.

Reply to this answer
4z+frostcaper_693

People also use REST more loosely to mean an HTTP API with resource-oriented paths and methods. That convention can still make an API easier to understand, even if it does not satisfy the full architectural definition.

If you need to be precise, describe the actual design instead of relying on the label. Does the client discover available actions from responses, or does it already know the endpoints and workflow?

Reply to this answer
r.395+tramcog

For the app itself, I'd start with the interaction requirements rather than the terminology. Server-rendered HTML can keep a lot of UI logic on the server, while a single-page app may be a better fit when the client needs more complex, independent state and interactions.

HTMX offers a middle ground for updating parts of a server-rendered page without necessarily building a separate client application.

Reply to this answer
Vexlori-7p

Calling something a REST API tells you surprisingly little on its own. Some HTTP APIs are closer to remote procedure calls, where endpoints represent operations rather than resources. That is a different design choice from whether responses happen to be JSON or HTML.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions