vendredi 15 septembre 2017

Using wildcards (*) in REST API resource name

Is it sensible to use * in REST API for a resource ID? I want to use it for searching. I'm using RESTEasy for developing my webservice.

Suppose I have resources that are user and user has Name and Age. Then my REST API looks like:

/users/{id}/name
/users/{id}/age

Now if I want to display all names I'm thinking on using the following:

/users/*/name

Is this correct or should I use another way of doing?

Aucun commentaire:

Enregistrer un commentaire