Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3607

Should a REST API select on a ID or a name field? [closed]

$
0
0

I'm designing a REST API and trying to decide which is the more correct way of returning a single resource:

/resource/{id}

or

/resource/{name}

The ID would be immutable, so I'm thinking that it would be better to select by it, but name would be more friendly looking. What is the best practice? I've seen both used before "in the wild".


Viewing all articles
Browse latest Browse all 3607

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>