In salesforce apex, I have one custom API, It's working fine on the workbench but not work on POSTMAN, I have an access token, this works fine with GET method, but why not work with POST in POSTMAN?
APEX custom POST api is
@RestResource(urlMapping='/contactapi/*')
global with sharing class PostContactResouceWithParameter {
@HttpPost
global static String createNewContact(String firstName, String lastName, String birthDate, String leadSource) {
Contact contact = new Contact();
contact.FirstName = firstName;
contact.LastName = lastName;
contact.Birthdate = Date.parse(birthDate);
contact.LeadSource = leadSource;
//insert contact;
return 'success';
}
}
After POST always get 405 status.