title: Designing proper REST URIs
body: <p>I have a Java component which scans through a set of folders (input/processing/output) and returns the list of files in JSON format. </p>
  
  <p>The REST URL for the same is:</p>
  
  <pre><code>GET http://&lt;baseurl&gt;/files/&lt;foldername&gt;
  </code></pre>
  
  <p>Now, I need to perform certain actions on each of the files, like validate, process, delete, etc. I'm not sure of the best way to design the REST URLs for these actions.
  Since its a direct file manipulation, I don't have any unique identifier for the files, except their paths. So I'm not sure if the following is a good URL:</p>
  
  <pre><code>POST http://&lt;baseurl&gt;/file/validate?path=&lt;filepath&gt;
  </code></pre>
  
  <p>Edit: I would have ideally liked to use something like /file/fileId/validate. But the only unique id for files is its path, and I don't think I can use that as part of the URL itself.</p>
  
  <p>And finally, I'm not sure which HTTP verb to use for such custom actions like validate. </p>
  
  <p>Thanks in advance!</p>
  
  <p>Regards,
  Anand</p>