Here It is my solution which based on REST guides and recommendations:
LOGIN - create a resource
Request:
POST => https://example.com/sessions/ BODY => {'login': '[email protected]', 'password': '123456'} Response:
http status code 201 (Created) {'token': '761b69db-ace4-49cd-84cb-4550be231e8f'} LOGOUT - delete a resource
Request:
DELETE => https://example.com/sessions/761b69db-ace4-49cd-84cb-4550be231e8f/ Response:
http status code 204 (No Content)