I am trying to test my code from workbench by sending an xml file to my @restresource global class. I have a @httpPost method through which I wan to insert the record. When I try to send a request to my class I am getting error : URL not found My class code
@RestResource(urlMapping='/Lead')
global with sharing class ParentRest {
@HttpPost
global static Lead doPost() {
RestRequest req = RestContext.request;
system.debug('The request ' + req);
return null;
}
}
My workbench Url
/services/apexrest/lead
Workbench header
Content-Type: application/XML; charset=UTF-8
Accept: */*
Error on workbench:
[ {
"errorCode" : "NOT_FOUND",
"message" : "Could not find a match for URL /lead"
} ]
What will be the reason. Anyone have any idea what will be the reason? Please guide me how to solve this issue.