Okay I hear that thing all the time on internet when reading an article about MVC : “Since Asp.NET MVC is REST, it is easy to consume … etc.” I’ve never heard such a thing for Asp.NET Webforms and it makes me wonder what makes something REST.
As I understood, REST means Representational State Transfer in which what a user see on their browser is a state. But I don’t think it means it always should be like RPC as MVC does. It could be a physical page served by the server like how it works in Asp.NET WebForms (Default.aspx) As long as it returns a state representation, it is called REST.
So if my understanding is fine, then shouldn’t webforms be also REST?
Uggh, I am kinda confused….
Thanks in advance….
Edit and brief answer :
Okay folks, listen up 🙂 this is the answer I believe which is correct :
As we know it REST should match basic principles below :
* Give every “thing” an ID
* Link things together
* Use standard methods
* Resources with multiple representations
* Communicate statelessly
So as we know it, webforms use highly postbacks, session to get idea about the previous requests and you can do postback countless times to get something like :
search.aspx and post the selected value of a dropdownmenu and there is no get, only post and postback from the server.
Well it obviously cannot be restful architectural style.
It is surprising statement. If I use session in ASP.NET MVC it will not be REST at all.
Edit:
REST is stateless. If I use session the prcessing will become stateful. Subsequent requests will be able to use state (from session) so the HTTP response will not contain whole state.