What is the difference (if any) between a route and an endpoint in the context of a RESTful API?

3 different concepts here:

  • Resource: {id: 42, type: employee, company: 5}
  • Route: localhost:8080/employees/42
  • Endpoint: GET localhost:8080/employees/42

You can have different endpoints for the same route, such as DELETE localhost:8080/employees/42. So endpoints are basically actions.

Also you can access the same resource by different routes such as localhost:8080/companies/5/employees/42. So a route is a way to locate a resource.

  • Read more: Endpoint vs. route

  • Read more: Endpoint vs. resource

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)