function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KruviKruvi 

Testing an APEX REST service

Hello

 

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

@HttpGet
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

 


KruviKruvi

Can someone help here?

Rajesh SriramuluRajesh Sriramulu

Hi

 

 

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);

 

 

SRS