REST Web Services

Official Content
This documentation is valid for:

Web services allow programs written in different languages and running on different platforms to communicate with each other following standards. There are cases where we want to access to resources provided by other applications with particular emphasis on the optimization of HTTP traffic (important when clients are mobile devices for example).

REST is a style of web services design, which guarantees Interoperability under a paradigm of simplicity and "saving of resources".

In GeneXus, REST solutions can be incorporated into applications very easily.

Basically, the goal is to expose application data or what we call "resources" or entities on the web, with an output with a standard format (XML, JSON), to be interpreted by a program that runs on any platform or framework, or even on any HTTP client.

arquitrest

SOAP solution to the problem of interoperability: REST

There are some protocols and standards built on HTTP that are designed to create web services such as as WS *. Soap is a lightweight protocol for exchange of information in a decentralized, distributed environment; data representation is done through XML protocol. A SOAP message is an XML document that consists of a mandatory SOAP envelope, an optional header, and a required body. Another solution to the same problem: REST.

The following is an example of invoking a REST service where you can see in the HTTP header the invocation (HTTP GET) and the body's response (JSON containing the answer.) Note that the answer is a list of products where each product contains a URI to access the product detail. The response is characterized by being compact and lightweight.

headertcptracerest
bodytcptracerest

Check the REST Protocol considerations section to understand what is REST and the considerations to take into account when designing a REST based API.

Subcribe to this category's changes
Sub CategoriesAdd a new subcategory in this category
PagesAdd a new page in this category