RestContext Class
Contains the RestRequest and RestResponse objects.
Use the System.RestContext class to access the RestRequest and RestResponse objects in your Apex REST methods.
The following example shows how to use RestContext to access the RestRequest and RestResponse objects in an Apex REST method.
The following are properties for RestContext.
-
Returns the
RestRequestfor your Apex REST method. -
Returns the
RestResponsefor your Apex REST method.
Returns the RestRequest for your Apex REST method.
public RestRequest request {get; set;}
Type: System.RestRequest
Returns the RestResponse for your Apex REST method.
public RestResponse response {get; set;}
Type: System.RestResponse