title: Update a single property in a REST API
body: <p>In designing a new API, we are doing our best to follow the patterns established by REST. The question I have is the best method to follow when trying to update a single property. For example:</p>
  <p>Imagine you have a simple Car resource:</p>
  <pre><code>{
     &quot;make&quot;: &quot;Chevrolet&quot;,
     &quot;model&quot;: &quot;Chevelle&quot;,
     &quot;year&quot;: 1966,
     &quot;color&quot;: &quot;black&quot;,
     &quot;for_sale&quot;: true
  }
  </code></pre>
  <p>Let's assume that the property <code>for_sale</code> is something that you anticipate will be updated regularly by the user. I have a couple options:</p>
  <ol>
  <li><p><code>PUT</code> the entire resource with <code>for_sale</code> set to <code>false</code>. For a reasonably small resource, this seems fine, however, in most cases our resources are quite large so a lot of waste in sending the entire resource to update a single, often changed property.</p>
  </li>
  <li><p><code>POST</code> and do a partial update by only including the element to update, such as:
  <code>{&quot;for_sale&quot;:false}</code> This is better as it requires a lot less overhead.</p>
  </li>
  </ol>
  <p>But I somehow seem to be reaching for something even more simple, but I don't seem to find the right approach. It would be quite convenient to offer a simple <code>PUT</code> to a URL (that doesn't require any request body) to update this property. I see what Google is doing in their API to accomplish this, but it feels just a bit RPC-ish, although I like the simplicity.</p>
  <p><code>POST</code>  <code>/blogs/blogId/posts/postId/comments/commentId/approve</code>
  (marks a comment as not spam)</p>
  <p><code>POST</code>  <code>/blogs/blogId/posts/postId/comments/commentId/spam</code> (marks a comment as spam)</p>
  <p>Can someone offer some advice on the best way to approach updating a single property within a resource (in a preferably lightweight manner) that followed REST principles?</p>