0

If REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operations, how should be designed(verb & path) operations like:

  • register
  • authentication/deauthentication
  • reset password
Sodiaan
  • 341
  • 1
  • 3
  • 10

1 Answers1

1

Register: You could regard this as creating an account: POST /.../accounts

Auth/Deauth: Do you mean creating and deleting a session? Then it's a POST and a DELETE respectively: POST /.../sessions ; DELETE /.../session/{sessionid}. Strictly speaking, sessions are not restful. For more information, see "Do sessions really violate restfulness".

Reset password: Can be regarded as an update of a part of the account: PATCH /.../accounts/{accountid}. If the password is a separate resource, you could do PUT instead of PATCH: PUT /.../accounts/{accountid}/password

Community
  • 1
  • 1
www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32