REST basically just refers to the use of the HTTP protocol as it was intended. Use the HTTP GET
method for the URL to retrieve information, possibly in different formats based on Accept
HTTP headers. Use the HTTP POST
method to create new elements on the server, PUT
to edit existing elements, DELETE
to delete them. Make an idempotent API, i.e. Repeating the same query with the same information should give the same result. Organize your URLs hierarchically, etc.
REST is simply the guiding principle for using URLs and the HTTP protocol to structure the API. It says nothing about return formats, which could also be JSON.
This contradicts, for example, APIs sending binary or XML messages to a designated port without using differences in HTTP methods or URLs in general.
source share