Now that we've covered the main REST principles, let's dive deeper into what can be achieved when they are followed:
A resource is just a set of information, and as defined by Principle 4, it can have multiple representations; however, its state is atomic. It is up to the caller to specify the desired media type with the accept header in the HTTP request, and then it is up to the server application to handle the representation accordingly and return the appropriate content type of the resource and a relevant HTTP status code:
HTTP 200 OKin the case of success
HTTP 400 Bad Requestif an unsupported ...