rest - Name or ID as url for restful api -
i build restful api users route. more idioatic use username or id parameter if username unique?
either
example.com/api/users/johndoe or
example.com/api/users/123456 furthermore planed routes project resource. inconsistent design, if require project-id here?
usually username can remembered more recommend use id in username there may spaces or other characters (for example german umlaute) difficult format url. may be, user changes name. links invalid in opposite id.
Comments
Post a Comment