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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -