rest - How to deal with GET request and (not to) changing the application state? -


this generic question method.

imagine need store last pagination size selected user:

+-------------+   +-------------+    +--------------------+    +----------+ | size change |-> | request | -> | server store pref. | -> | response |  +-------------+   +-------------+    +--------------------+    +----------+ 

browsing list of products of course request , changing paging size request (we change size parameter):

<ul>     <li><a href="/catalog/browse/size=10&page=1">size 10</a></li>     <li><a href="/catalog/browse/size=25&page=1">size 25</a></li>     <li><a href="/catalog/browse/size=50&page=1">size 50</a></li> </ul> 

every time user changes size need store new size in backend.

how deal the fact should not change state? issuing query (thus changing state of application) fees wrong me. there alternative?

get requests representation of specified resource. requests using should retrieve data , should have no other effect.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -