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

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -