You need to sign in to do that
Don't have an account?
Lukesh Karmore
what it return in rest class
what it return
map<string,object> params=(map<string,object>)Json.deseriliazeUntype(request.requestBody.toString);
here (request.requestBody.toString); is used for
thank you
map<string,object> params=(map<string,object>)Json.deseriliazeUntype(request.requestBody.toString);
here (request.requestBody.toString); is used for
thank you
If the Apex method has no parameters, then Apex REST copies the HTTP request body into the RestRequest.requestBody property.
If there are parameters, then Apex REST attempts to deserialize the data into those parameters and the data won't be deserialized into the RestRequest.requestBody property.
I recommend reviewing the elaborate information provided by sfdcfox on https://salesforce.stackexchange.com/questions/15578/restrequest-requestbody-instead-of-params regarding this
Related: https://salesforce.stackexchange.com/questions/137599/restcontext-request-requestbody-encoding-decoding-5d
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you