RESTfully design /login or /register resources?

RESTful can be used as a guideline for constructing URLs, and you can make sessions and users resources: GET /session/new gets the webpage that has the login form POST /session authenticates credentials against database DELETE /session destroys session and redirect to / GET /users/new gets the webpage that has the registration form POST /users records … Read more

How to create REST URLs without verbs?

General principles for good URI design: Don’t use query parameters to alter state Don’t use mixed-case paths if you can help it; lowercase is best Don’t use implementation-specific extensions in your URIs (.php, .py, .pl, etc.) Don’t fall into RPC with your URIs Do limit your URI space as much as possible Do keep path … Read more

When do I use path params vs. query params in a RESTful API?

Best practice for RESTful API design is that path params are used to identify a specific resource or resources, while query parameters are used to sort/filter those resources. Here’s an example. Suppose you are implementing RESTful API endpoints for an entity called Car. You would structure your endpoints like this: GET /cars GET /cars/:id POST … Read more