Newer Version Available
RestContext Class
Namespace
Usage
Use the System.RestContext class to access the RestRequest and RestResponse objects in your Apex REST methods.
Sample
The following example shows how to use RestContext to access the RestRequest and RestResponse objects in an Apex REST method.
RestContext Properties
The following are properties for RestContext.
request
Returns the RestRequest for your Apex REST
method.
Signature
public RestRequest request {get; set;}
Property Value
Type: System.RestRequest
response
Returns the RestResponse for your Apex REST
method.
Signature
public RestResponse response {get; set;}
Property Value
Type: System.RestResponse