+ Start a Discussion

Cannot call APEX REST POST method which was working before


I have the following APEX rest method:


global with sharing class TestService {
global static String Scheduler() {
     return 'TEST';



When I try to call it with:

curl -X POST -H "X-PrettyPrint:1" -H "Content-Type:application/x-www-form-urlencoded" -k "https://na12-api.salesforce.com/services/apexrest/TestService/Scheduler?schedule=1&hour=22&minute=48" -H "Authorization: Bearer SESSION_ID"

It returns the following error message:

[ {
"message" : "An unexpected error occurred. Please include this ErrorId if you
contact support: 330346244-51980 (863387990)",
} ]


when I change ti to @HttpGet and I call it with curl -X GET -H "X-PrettyPrint:1" -H "Content-Type:application/x-www-form-urlencoded" -k "https://na12-api.salesforce.com/services/apexrest/TestService/Scheduler?schedule=1&hour=22&minute=48" -H "Authorization: Bearer SESSION_ID"


I get the expected result.


Any help will be appreciated.