title: REST best practice for getting a subset list
body: <p>I read the article at <a href="https://stackoverflow.com/questions/1296421/rest-complex-applications">REST - complex applications</a> and it answers some of my questions, but not all.</p>
  
  <p>I am designing my first REST application and need to return "subset" lists to GET requests. Which of the following is more "RESTful"?</p>
  
  <pre><code>/patients;listType=appointments;date=2010-02-22;user_id=1234
  </code></pre>
  
  <p>or</p>
  
  <pre><code>/patients/appointments-list;date=2010-02-22;user_id=1234
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>/appointments/2010-02-22/patients;user_id=1234
  </code></pre>
  
  <p>There will be about a dozen different lists that I need to return. In some of these, there will be several filtering parameters and I don't want to have big 'if' statements in my server code to select the subsets based on which parameters are present. For example, I might need all patients for a specific doctor where the covering doctor is another and the primary doctor is yet another. I could select with</p>
  
  <pre><code>/patients;rounds=true;specific_id=xxxx;covering_id=yyyy;primary_id=zzzz
  </code></pre>
  
  <p>but that would require complicated branching logic to get the right list, where asking for a specific subset (rounds-list) will achieve that same thing.</p>
  
  <p>Note that I need to use matrix parameters instead of query parameters because I need to do filtering at several levels of the URL. The framework I am using (RestEasy), fully supports matrix parameters.</p>