Which HTTP method should Login and Logout Actions use in a “RESTful” setup

前端 未结 2 519
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 17:52

Curious how others here would represent these in a REST architecture.

/users/login/
/users/logout/

These endpoints set up the session to lo

2条回答
  •  再見小時候
    2021-01-03 18:23

    maybe CONNECT? MDN says:

    The HTTP CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel.

    as login means maintaining a session between browser and server, CONNECT method makes the most sense.

提交回复
热议问题