Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.23 KB

README.md

File metadata and controls

35 lines (24 loc) · 1.23 KB

REST & Relaxation

By Michael Smart

Description: An example of a REST web service implemented with ObjectScript that demonstrates a number of development best practices. This is the companion to a live webinar presented by InterSystems Learning Services on December 7, 2017.

Requirements: 2016.2 or higher.

To install:

  1. Create the CSP application /rnr for the desired namespace.
  2. Set the Dispatch Class option for /rnr to RNR.Service.
  3. Load the files in the RestAndRelaxation directory to a new project using Atelier.
  4. Compile the new project in Atelier.

Instructions:

You can consult the URLMap in the RNR.Travel.BestPractices class to see which resources are available. Here are a few examples you can try with your favorite REST testing utility.

  • To retrieve a list of travel reservations, make a GET request to http://<server>:<port>/rnr/travel/reservations.

  • To add a new travel reservation, send a POST request to http://<server>:<port>/rnr/travel/reservation using the following JSON as an example for the request body:

{
    "customer": "Michael",
    "startLocation": "Boston",
    "destination": "London",
    "startDate": "2018-02-01",
    "endDate": "2018-02-10"
}

Enjoy!

— MS