Versions Compared

Key

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

Whether or not a fully RESTful approach is used, the SRP HTTP Framework assumes the entire URL is meaningful. This is different from the RPC approach which fundamentally only cares about the command which appears before the “?” character and the query params which appear after the “?” character. Therefore, URLs are treated as paths which must begin at an entry point and then navigate to a final destination (end point). ) In fact, it is helpful to consider URLs as paths and the calling of an API as an attempt to map a path toward the end point destination.

To aid us in this understanding some terminology must be established. The following URL will be used for reference:

  • API URL – The API URL is the beginning portion of the URL that is minimally necessary to gain access to the API logic on the server. For instance, in the above example, https://www.myapplication.com/api is the API URL but https://www.myapplication.com is the domain and likely displays a home page (e.g., index.html). If the entire website is managed by API logic then these URLs would be one and the same.

  • Entry Point – Whether the API URL is submitted alone or with additional information (as pictured above), the request will begin with the entry point. This serves as a “front gate” and will determine if and how the next step in the URL path will be handled.

  • URL Segments Also known as paths. These are the parts of the URL which are separated by the “/” character. In the above URL, customers is a segment, 5678 is a segment, and invoices is a segment. Starting with the entry point, the API navigates its way through each segment (or path) in a natural way. This is intended to assist the user with an intuitive understanding of the API. Thus, the URL above should hopefully be understood as “Invoice #1234 that belongs to Customer #5678”.

  • End Point – This is a special URL segment that denotes the end of the URL itself. End points typically contain the name of a resource type (e.g., customers or invoices) or a specific resource identifier (e.g., 5676 or 1234). The end point is where the resolution of the request occurs.

...