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

What are best practices for REST nested resources?

I’ve tried both design strategies – nested and non-nested endpoints. I’ve found that: if the nested resource has a primary key and you don’t have its parent primary key, the nested structure requires you to get it, even though the system doesn’t actually require it. nested endpoints typically require redundant endpoints. In other words, you … Read more

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