+ Start a Discussion

Testing an APEX REST service



I wrote an APEX REST service which excepts a RestRequest object as an input.

global static Account doGet(RestRequest req, RestResponse res){


How do I test this method?

Do I need to create a RestRequest object to pass to the method?

If so how do I put the URI inside the RestRequest object?


Many thanks



Can someone help here?

Rajesh SriramuluRajesh Sriramulu




what is RestResponse     is it object?


any how try this


we have to create objects from a class and pass that objects to  the method doget(req,res)

and call this method with class directly


eg : Account accc1 = RestRequest.doGet(req,res);