I'm working with a third party vendor and they send notifications when forms are submitted in their system to RestResource in Salesforce. Problem I'm having is to receive JSON over XML I have to accept JSON in the header, but I'm not sure if that is possible (or I'm doing something wrong or there is something wrong on their end).
I have class I'm using to deserialize the JSON into a class and I have tested in Workbench to verify.
@RestResource(urlMapping='/formreceipt')
global class REST_FormReceipt {
@HttpPost
global static void formReceipt() {
RestContext.request.addHeader('Accept', 'application/json');
FormReceipt data = FormReceipt.parse(RestContext.request.requestBody.toString());
}
}
Would I have to setup my RestResource method differently?
Andy