Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SRP HTTP Framework basically involves two steps: defining resources and creating APIs. A resource definition enables the SRP HTTP Framework to determine if an incoming request is legitimate. An API contains the programming logic to create the digital resource that gets returned. Each of these steps can be simple or complex, depending upon the needs of the application. However, once the basic workflow steps are understood, creating rich resources and elaborate APIs becomes much easier.

...

In each of our APIs there is a call into the LoremIpsum service (a member of the HTTP_Resource_Services module). The purpose of this special service is to enable the new API to produce sample content so the API can be tested immediately . However, we(see our How do a create an API? article for an example of this).

Making APIs Functional

We'll assume that our APIs are responding properly to requests so we are now ready to make our APIs function the way we want. The way this gets done can vary greatly based on the nature of the resource, the purpose of the API, and the overall design intent of the application. In simple cases where the resource is related to a database table, we can use some high-level services to make this quick and easy.

...

Since our customers resource is related to the CUSTOMERS database table, the following code will work:

Image Added

Obviously there is a lot of automation going on behind these services. Your code might look very different. We encourage you to start with our How do I create a resource? article to get a feel for the different ways this task can be approached.

...