asp.net web api - REST API URI Design for users and sessions? -
i'm new rest design i'd pointers here.
here have far:
get /api/users //all users /api/users/123 //specific /api/users/me //get own profle post /api/users/me/session //start new session (login) delete /api/users/me/session //ends current session (logout)
i'm wondering session / login/out stuff here. thinking correct here or should designed in other way more rest'ish?
also, register user, should be:
post /api/users
even if starts new session?
i recommend avoid term session , use auth (as in authentication). term session gives impression of server-side session goes against rest.
the following good:
get /api/users //all users /api/users/123 //specific /api/users/me //get own profile
for authentication, may have this:
post /api/auth //username/password required. auth_token sent delete /api/auth //auth_token sent in http header
Comments
Post a Comment