title: How to design a REST API with LIKE criteria?
body: <p>I'm designing a REST API and have an entity for "people":</p>
  
  <pre><code>GET http://localhost/api/people
  </code></pre>
  
  <p>Returns a list of all the people in the system</p>
  
  <pre><code>GET http://localhost/api/people/1
  </code></pre>
  
  <p>Returns the person with id 1.</p>
  
  <pre><code>GET http://localhost/api/people?forename=john&amp;surname=smith
  </code></pre>
  
  <p>Returns all the people with matching forenames and surnames but I have a further requirement. What is the cleanest / best practice way of allowing API consumers to retrieve all the people whose forename starts with "jo" for example.</p>
  
  <p>I've seen some APIs do this like:</p>
  
  <pre><code>GET http://localhost/api/people?forename=jo~&amp;surname=smith
  </code></pre>
  
  <p>where the tilde signifies a "fuzzy" match. On the other hand I've seen it implemented with a totally different criteria e.g.</p>
  
  <pre><code>GET http://localhost/api/people?forename-startswith=jo&amp;surname=smith
  </code></pre>
  
  <p>which seems a bit cumbersome considering I might have -endswith, -contains, -soundslike (for some sort of soundex match).</p>
  
  <p>Can anyone suggest from experience which works better and also any examples of well designed REST APIs that have similar functionality.</p>