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

前端 未结 2 520
被撕碎了的回忆
被撕碎了的回忆 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:38

    You should use POST - using GET for these actions can lead to issues with browser prefetching and search engine spidering. See (1, 2)

提交回复
热议问题