title: Delphi XE2: How to define custom DataSnap REST URI?
body: <p>I am using Delphi XE2 to write DataSnap REST service.  I notice that the REST URI in DataSnap must strictly follow this format (refer <a href="http://docwiki.embarcadero.com/RADStudio/en/REST" rel="noreferrer">here</a>):</p>
  
  <pre><code>http://my.site.com/datasnap/rest/URIClassName/URIMethodName[/inputParameter]*
  </code></pre>
  
  <p>A famous example is sample method create by DataSnap server wizard:</p>
  
  <pre><code>http://my.site.com/datasnap/rest/TServerMethods1/ReverseString/ABC
  </code></pre>
  
  <p>There are 2 common ways to supply parameters in URI:</p>
  
  <ol>
  <li>Path Segment parameter: /TServerMethods1/ReverseString/ABC</li>
  <li>Query String parameter: /TServerMethods1/customers?name=bill</li>
  </ol>
  
  <p>The Path Segment parameter URI is definitely supported by DataSnap REST.  Is Query string parameters URI support in DataSnap REST too?</p>
  
  <p>I have the following REST URI example and found it seems impossible to make it work with current DataSnap REST library:</p>
  
  <ol>
  <li><p><strong>/customers/A1234</strong></p>
  
  <p>return customer object of ID A1234</p></li>
  <li><p><strong>/customers/A1234.xml</strong></p>
  
  <p>return customer object of ID A1234 in XML format</p></li>
  <li><p><strong>/customers/A1234.json</strong></p>
  
  <p>return customer object of ID A1234 in json format</p></li>
  <li><p><strong>/customers/A1234.html</strong></p>
  
  <p>return customer object of ID A1234 in html format</p></li>
  <li><p><strong>/customers?name=Bill</strong></p>
  
  <p>return a list of customer whose name contain Bill</p></li>
  </ol>