Versions Compared

Key

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

...

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 workwe'll update our API commuter module as follows:

Obviously there is a lot of automation going on behind within these services. Your Depending upon your needs, 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.

In Summary

Hopefully this illustration encourages you to use the SRP HTTP Framework with a sense of confidence. Quite often the developer just repeats the above steps as new resources are added to the application or when existing resources are updated (e.g., a new method is added to an endpoint that didn't exist before). There are other important elements that this article did not explore, such as authentication, authorization, unique resource media types, hypermedia, etc., but these will all come in good time and will be easier to implement once you master the basics.