REST
A REST API is (an interface definition of) a Web Application that can return data and execute actions on data.
A REST API is a framework for consuming services, which heavily relies on HTTP. The URI of the request
indicates what data that is operated on. The HTTP Method specifies how is operated on that data.
The HTTP Return code indicates whether the operation was successful, and, if not, gives an indication why not.
The payload
is supposed to be JSON.
Advantages and Disadvantages
The advantages of REST API is that it does NOT have the following things:
- Though XML provides
XML Namespaces
, in practice one doesn’t need it. After all, if you are calling a specific API the context (and thus the Namespace) is obvious. - And though schema validation is a nice feature, one doesn’t need that either, only in Design Time, and there are plenty of tools that can help in that area.
- JSON is both less bloaty than XML, and it is easier to parse.
The main disadvantage of REST APIs is that it still uses HTML, which is relatively slow with a relatively high overhead.