+ Start a Discussion
Saikishore Reddy AengareddySaikishore Reddy Aengareddy 

rest resource urlmapping case insensitive

REST call to:

/services/apexrest/cms/v1/sample/returnsample/home-page/usa/es

should behave the same as

/services/apexrest/cms/v1/saMple/returNsample/home-page/usa/ESor /services/apexrest/cms/v1/sample/returnsample/hOme-pAGe/uSa/eS

How can we achieve this? Is this possible?
pbattissonpbattisson
Apex REST resource mappings are case sesnistive by default (this is listed in the documentation here (http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_rest_code_sample_basic.htm|StartTopic=Content%2Fapex_rest_code_sample_basic.htm|SkinName=webhelp)). The simplest solution is to have multiple REST classes each showing the possible URLs (so a resource for .../usa/es, .../usa/ES, .../usa/Es, .../usa/eS) and then the relevant methods in each class calling back into an extracted shared class containing the logic. 

In general it is a best practice to have all resources and URIs as lower case as it is easier to type and also URIs are not case sensitive. I struggle to think of an API using uppercase or camelCase.