How do I make my Web Application stateless yet still do something useful?

后端 未结 5 1325
离开以前
离开以前 2020-12-09 11:04

I\'ve seen this advice...

ideally the web should follow the REST principle and be completely stateless. Therefore a single URL should identify a singl

5条回答
  •  [愿得一人]
    2020-12-09 11:54

    It is okay to maintain resource state. The "stateless prohibition" just refers to session state.

    Here's an excerpt from Roy Fielding's seminal REST derivation:

    We next add a constraint to the client-server interaction: communication must be stateless in nature, as in the client-stateless-server (CSS) style of Section 3.4.3 (Figure 5-3), such that each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client.

提交回复
热议问题