I am using Delphi XE2 to write DataSnap REST service. I notice that the REST URI in DataSnap must strictly follow this format (refer here):

http://my.site.com/datasnap/rest/URIClassName/URIMethodName[/inputParameter]*

A famous example is sample method create by DataSnap server wizard:

http://my.site.com/datasnap/rest/TServerMethods1/ReverseString/ABC

There are 2 common ways to supply parameters in URI:

  1. Path Segment parameter: /TServerMethods1/ReverseString/ABC
  2. Query String parameter: /TServerMethods1/customers?name=bill

The Path Segment parameter URI is definitely supported by DataSnap REST. Is Query string parameters URI support in DataSnap REST too?

I have the following REST URI example and found it seems impossible to make it work with current DataSnap REST library:

  1. /customers/A1234

    return customer object of ID A1234

  2. /customers/A1234.xml

    return customer object of ID A1234 in XML format

  3. /customers/A1234.json

    return customer object of ID A1234 in json format

  4. /customers/A1234.html

    return customer object of ID A1234 in html format

  5. /customers?name=Bill

    return a list of customer whose name contain Bill

Edit
Report