I've setup a RestResource that receives a webhook from Mailchimp. When setting up the webhook in Mailchimp it verifies the webhook URL exists by calling it with a GET Method but then sends all future requests as POST Methods.
How can I setup my rest resource to handle a Get and Post on the same method while avoiding the Method already defined error?
@RestResource(urlMapping='/mailchimp/*')
global without sharing class RestMailchimpWebhook {
@HttpPost
global static void callbacks(){
... // handle webhooks
}
@HttpGet
global static void callbacks(){
... //handle verification
}
}