What does Representational State mean in REST?

前端 未结 8 742
执笔经年
执笔经年 2021-01-30 02:58

I have been reading all over the net to get the exact meaning of two words:

REPRESENTATIONAL STATE

I have a doubt. I am misunderstanding these terms. i want to

8条回答
  •  隐瞒了意图╮
    2021-01-30 03:48

    Imagine a state diagram - the following will do.

    If this were the set of web pages, you would start at Undergraduate landing page for a student. Per the diagram, when you would click on the "Next" link, it will take you to Freshman page - assume the student has graduated. By clicking on "next" multiple times, you get to the last page.

    Of course, there could be other transitions like "Home" allowing you to jump to the default page.

    The visible state of the website has nothing to with how server implements this association internally - that is the internal states. It may involve multiple databases, servers and what not. A student may graduate and his/her status may have been updated via other methods. The client is not aware of these details - but can always expect to get a coherent visible state (set) for human (or machine) consumption.

    Another example: As you are looking at this page, you in a particular identifiable and reproducible "location" in the StackOverFlow web hierarchy.

    So, RESTful State deals with navigation.

提交回复
热议问题