3 ms·
Here’s the issue: /api/v1/employees/<employee_id> These URLs, which philosophically we’re trying to convince each other are opaque resource identifiers, are
by bluesnowmonkey 4y ago
Here’s the issue:
/api/v1/employees/<employee_id>
These URLs, which philosophically we’re trying to convince each other are opaque resource identifiers, are actually structured requests.
There is an API being provided, specifying how to craft the URL, among other things. It’s not a “resource” at all, it’s a function call, and the difference becomes extremely evident as soon as you start needing to add variations to the request using query parameters.
Good APIs have few nouns and many verbs. That’s exactly the opposite of REST, which says you should have many nouns (URLs) and few verbs (HTTP methods).
REST is a misguided idea that an academic had years ago. It doesn’t work well and it certainly doesn’t represent some philosophical ideal. We should stop pursuing it.