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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -