Endpoint and payload anatomy
Endpoints and payloads are a crucial part of any API component. Endpoints facilitate access to resources on a server through the use of well-defined routes or URLs. Endpoints usually act as the actual point at which data exchange occurs between two disparate applications in a client-server environment. Payloads allow us to send data along with a request or a response. We will discuss more on payloads in a jiffy.
Let’s start by examining the structure of an endpoint and the rules guiding endpoints set up in a REST API.
Understanding the endpoint structure
Endpoint structures allow you to logically organize the resources of your application. We are going to start with a venue
resource in exploring endpoint structure. Data is usually represented as resources in a REST API. You can define an endpoint for a venues
collection with a venue
resource following the use of the collection/resource
path convention.
Note
The venue
resource represents...