REST - complex applications

后端 未结 5 1429
南方客
南方客 2020-12-02 04:06

I\'m struggling to apply RESTful principles to a new web application I\'m working on. In particular, it\'s the idea that to be RESTful, each HTTP request should carry enoug

5条回答
  •  佛祖请我去吃肉
    2020-12-02 04:52

    REST is for APIs, not (typical) applications. Don't try to wedge a fundamentally stateful interaction into a stateless model just because you read about it on wikipedia.

    To be Restful, should all this information be included with every request? This seems to place a huge overhead on the network. Also, wouldn't the restrictions on URL length, at least for GET, make this unfeasible?

    The size of parameters is usually insignificant compared to the size of resources the server sends. If you're using such large parameters that they are a network burden, place them on the server once and then use them as resources.

    There are no significant restrictions on URL length -- if your server has such a limit, upgrade it. It's probably years old and chock-full of security vulnerabilities anyway.

提交回复
热议问题