title: RESTful API design best practices
body: <p>I am current writing an API layer for my project, and am struggling with trying to figure out a good design approach for the following scenario:</p>
  
  <ol>
  <li>All users have a list of books</li>
  <li>Each list can be accessed via an ID</li>
  <li>Users can add and delete books at will</li>
  </ol>
  
  <p>Currently, I'm not sure which the best approach would be:</p>
  
  <pre><code>1) PUT - /api/list/{listID}/{bookID} - Add book to specified list
     DELETE - /api/list/{listID}/{bookID} - Remove book from specified list
  2) PUT - /api/list/{listID} - Send XML data to server that contains bookID and action
     &lt;list_payload&gt;
         &lt;action&gt;{delete|add}&lt;/action&gt;
         &lt;bookID&gt;{bookID}&lt;/bookID&gt;
     &lt;/list_payload&gt;
  </code></pre>
  
  <p>Any insight would be appreciated.</p>