Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>What is RESTful is the basically the question here.</h2> <p>If you want really deep fun explanation I strongly suggest that you check this epic and famous REST "article": <a href="http://tomayko.com/writings/rest-to-my-wife" rel="nofollow">How I Explained REST to My Wife</a></p> <p>So back you your concrete question. In the spirit of the REST you should create a proper "resource". In your case that means the "archive object" resource. And you just apply the HTTP verbs against it. This is in essence a RESTful service. </p> <p>If you try like you are trying to give an action a name, you are probably on the wrong path.</p> <p>So what to do? Create "archive object" WebAPI controller and then, I presume, depends weather the function is idempotent user the proper HTTP verb. POST for create, PUT for update scenario (idempotent function). Do not forget to return in POST (create) scenario the new resource URI. But as far as I can see form your code you are up to the PUT scenario. Since you are able (I presume) to archive object many times.</p> <p>How to sent additional data (in your case <code>{isArchived: true}</code>) to the API? Simpy, just put those kind of data into the body of the request. That's why we have the body message in HTTP requests.</p> <p>So, your PUT URI should look like:</p> <pre><code>PUT /api/objects/achive/1 </code></pre> <p>So that mean that you have object controller as well as "archive controller". Great is't it? And if you do the proper REST the API is really beautiful and easy to understand and use. This is all about of RESTful services.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload