3 ms·
I'm biased but I like my own design better: https://groups.google.com/forum/?fromgroups#!topic/restful-json/jDNhjfh9hfg https://groups.google.com/forum/?fromgr
by pwpwp 14y ago
I'm biased but I like my own design better:
https://groups.google.com/forum/?fromgroups#!topic/restful-json/jDNhjfh9hfg https://groups.google.com/forum/?fromgroups#!topic/restful-j... (Google Groups breakage; link is meant to go to first post in discussion)
Instead of requiring that objects have a special _links property, you can put links anywhere in a JSON structure, just like in a HTML document.
Everything of the form
{ "$href": <url> [,"rel": <token>] [,"type": <media-type>] }
anywhere in a JSON object is treated as a link.
- AffableSpatula 14y agoPersonally I prefer HAL's model because it is couched in web terminology, i.e: - Resources - Resource state - Links hal+json results in more uniform representations, which makes it easier to write generic client + server client libraries for