Thursday, 30 August 2012

Retrieving a Record Using the Apex REST GET Method

In this lesson, you’ll use Workbench to send a REST client request to retrieve the new merchandise record you’ve just created in the previous lesson. This request invokes one of the Apex REST methods you’ve just implemented.
  1. In the REST Explorer, Click GET.
  2. In the relative URL box, append the ID of the record you copied from Lesson 2 of this tutorial to the end of the URL:/services/apexrest/Merchandise/.
  3. Click Execute. This causes the getMerchandiseById method to be called. The response returned contains the fields of the new merchandise record.

    Response returned by the REST GET method.
  4. Optionally, click Show Raw Response to view the entire response, including the HTTP headers and the response body in JSON format.

    Raw response returned by the REST GET request. 

No comments:

Post a Comment