What is the appropriate media type for Java – Hal JSON?
I'm using spring to create restful services, and I'm curious about the syntax of media types
According to my understanding, the general media type of Hal JSON is application / Hal JSON In addition, as I understand it, vendor specific custom media types that support Hal JSON will be similar to application / vnd api. entity. hal json. But I've also seen application / vnd api. entity hal json. Which one is right?
In addition, what is the correct wildcard type for Hal JSON? It is application / * Hal JSON or application / * Hal JSON Any relevant RFC links will be appreciated thank you!
Solution
application/vnd.api.entity+json
application/vnd.api.entity+json
application / vnd. api. entity. Hal JSON makes sense only if you plan to provide data without supporting Hal In any case, the customer must know the structure of the content, and Hal is a part of it
application / vnd. api. Entity Hal JSON is wrong Standard declaration should only use registered suffixes It also calls them "structured syntax suffixes" So it's clear that it's about how to read data, not what it means Only one suffix is allowed, and more is meaningless
Think of it as application / semantic syntax, or how the application / content reads it