Is it legal to have REST resource such as /currentUser in terms of RESTful and stateless?

前端 未结 5 1656
清歌不尽
清歌不尽 2021-02-09 17:10

In terms of RESTful and stateless it\'s pretty legal to have resource like

/users/123

But, the question is: is it legal to have resource that omits user id and

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-09 17:55

    It is OK as long as you use only the data from request (HTTP Headers in your case). In other words, this may work only for users that pass authentication.

提交回复
热议问题