How to create a custom media type (application/vnd) for a RESTful web service?

@JohnDoDo One first question: Does the media type define the contract between my server and client? Yes, media type is one part of the contract. Contract in REST API is not static unlike SOAP(i.e. WSDL). Contract is defined by combination of underlying protocol(i.e. HTTP), URIs and Media Types(it’s not prohibited to use several media types … Read more

Meaning and usage of “_embedded” in HATEOAS

There’s neither a REST nor a HATEOAS specification. Both are only concepts, or architectural styles, if you will. _embedded is part of the HAL format. It’s intended to embed (sic!) resources where otherwise only their URIs would be returned. For example GET http://localhost:8080/mywebservice/features is supposed to only return a list of URIs, like http://localhost:8080/mywebservice/features/GROUND, and … Read more

Spring HATEOAS versus Spring Data Rest

Spring HATEOAS provides common abstractions (representational models, a Link class, API to build links pointing to Spring MVC controllers, etc.) to ease building hypermedia driven REST APIs with Spring MVC in general. Thus, you can use it alongside Spring MVC to manually build those services. Spring Data REST uses Spring HATEOAS to automatically expose resources … Read more

what is hypermedia , hypermedia controls, hypermedia formats

There’s a lot of confusion about this, because most applications that call themselves REST don’t use hypermedia and aren’t REST at all. Hypermedia is a generalization of hypertext for content other than HTML. You can say hypertext is a subset of hypermedia. Hypermedia can be HTML in a browser, with all links, buttons and everything … Read more