Module 11: REST API
- First read this page then start the module with the GitHub classroom link below.
- Github Classroom Link: https://classroom.github.com/a/dtRToquQ
Resources
Setup
Install the Thunder Client Lightweight Rest API Client for VS Code extension.

Exercise 1:
- Review the code in the Module 10 repository.
- Edit line 38 of
pizzaAPI.cpp. Change the port number18080to a unique port number between15000and20000.app.port(/* YOUR PORT NUMBER HERE */).run(); - Run the
makecommand to build thepizzaAPI.$ make - Start the
pizzaAPIby running$ ./pizzaAPI - Using your web browser go to the following URL. Except change
cs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above in step 2.http://cs01:18080/api/toppings - What was returned? Enter that into the
README.mdfile in your module 10 GitHub repository. - Using your web browser go to the following URL. Except change
cs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above in step 2.http://cs01:18080/api/toppings/1 - What was returned? Enter that into the
README.mdfile in your module 10 GitHub repository.
Exercise 2:
- Using the Thunder Client Lightweight Rest API Client for VS Code extension. Create a new request by clicking the “New Request” button.
- Create a new
GETrequest like this one. Except changecs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above.

- Click the “Send” button. Then in the
README.mdfile explain the status and the body of theResponse. - In the
README.mdfile explain the code in thepizzaAPI.cppthat made this happen.
Exercise 3:
- Using the Thunder Client Lightweight Rest API Client for VS Code extension. Create a new request by clicking the “New Request” button.
- Create a new
GETrequest like this one. Except changecs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above.

- Click the “Send” button. Then in the
README.mdfile explain the status and the body of theResponse. - In the
README.mdfile explain the code in thepizzaAPI.cppthat made this happen.
Exercise 4:
- Using the Thunder Client Lightweight Rest API Client for VS Code extension. Create a new request by clicking the “New Request” button.
- Create a new
PUTrequest like this one. Except changecs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above. Note: you must also click theBodytab and enter the JSON string shown to modify the topping.

- Click the “Send” button. Then in the
README.mdfile explain the status and the body of theResponse. - In the
README.mdfile explain the code in thepizzaAPI.cppthat made this happen.
Exercise 5:
- Using the Thunder Client Lightweight Rest API Client for VS Code extension. Create a new request by clicking the “New Request” button.
- Create a new
POSTrequest like this one. Except changecs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above. Note: you must also click theBodytab and enter the JSON string shown to create the new topping.

- Click the “Send” button. Then in the
README.mdfile explain the status and the body of theResponse. - In the
README.mdfile explain the code in thepizzaAPI.cppthat made this happen.
Exercise 6:
- Using the Thunder Client Lightweight Rest API Client for VS Code extension. Create a new request by clicking the “New Request” button.
- Create a new
DELETErequest like this one. Except changecs01to the machine that you are logged into. (no change if you are usingcs01). Change the port number18080to the port number you selected above.

- Click the “Send” button. Then in the
README.mdfile explain the status and the body of theResponse. - In the
README.mdfile explain the code in thepizzaAPI.cppthat made this happen.