Quick response on this would be helpful. I'm able to send request body from Workbench as source to my org as destination for creation of records. But what i need is how to perform the same operation using Postman tool or something else. Basically i have add authentication on my webservice class(means i have to allow my @httpPost method to access by only those for whom i give permission in my salesforce org based on username and password / Oauth methos.). Its for Webservice class @httpPost method.
This is the way i found out to do, I tried this with postman tool. First enter the below URL with respective parameters and make a request for access token
Endpoint url = https://"yourOrgInstance".salesforce.com/services/oauth2/token
client_id = 3MVG99S6MzYiT5k8Wklml6FnGX5UVDSDSASADSAV.lWcKcPlMhaikiPoapcdX, client_secret = 641362283729873987213897123, username = firstname.lastname@example.org, password = *********, grant_type = password.
AFTER OBTAINING THE ACCESS TOKEN
Endpoint url = https://"yourOrgInstance".salesforce.com/services/apexrest/StudentsDetails
Content-Type = application/json, Authorization = Bearer 00D0l000000Cssm!AQEAQAhRNEsMvWDunFuM7XaPUs58vyI5wWYyLu06I5tUdCmoG3O5FsqRiVuL0JYM6091nUP0UlHGuzN60rBvkTMIiKyEQ6aK or Authorization = Bearer "AccessToken"
now add your request body and make a call.