0% found this document useful (0 votes)
130 views2 pages

Lab 7 - Part 1

This document provides requirements for a lab assignment to create a RESTful web API with PHP. Students must create a folder called WebServices, add an .htaccess file with URL rewrite rules, and develop a PHP project called CST8259Lab7Part1. The project must provide a RESTful API with GET, POST, PUT, and DELETE methods to retrieve, add, update, and delete restaurant review data from an XML file. Students will test the API using Postman or another client and demo their work during the following lab session.

Uploaded by

Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views2 pages

Lab 7 - Part 1

This document provides requirements for a lab assignment to create a RESTful web API with PHP. Students must create a folder called WebServices, add an .htaccess file with URL rewrite rules, and develop a PHP project called CST8259Lab7Part1. The project must provide a RESTful API with GET, POST, PUT, and DELETE methods to retrieve, add, update, and delete restaurant review data from an XML file. Students will test the API using Postman or another client and demo their work during the following lab session.

Uploaded by

Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Algonquin College, School of Advanced Technology

CST8259 Web Programming Language II

Lab 7 – Part 1

Objective
Create a Restful Web API with PHP

Due Date
See Brightspace posting for the due date of this lab. To earn 5 points, you are required:

1. Complete the lab as required.

2. Submit your lab work to the Brightspace before the due date.

3. Demo your lab work during the following week’s lab sessions.

Requirements
1. Create a new folder WebServices inside AMPPS’ www folder. Add a .htaccess file
to define the necessary URL rewrite rules to forward restaurant view Web API’s
URLs to their corresponding URL to RestaurantReview.php.

2. Develop an PHP project CST8259Lab7Part1 to provide the following Restful


Service API:

 Get All Restaurant Reviews – Accept a HTTP GET request without review’s ID,
return a json string of a list of Restaurant objects containing the restaurant
review data in your restaurant_review.xml file.

 Get Restaurant Review by Id – Accept a HTTP GET request with a review’s ID,
returns a json string of a Restaurant objects containing the restaurant review data.

 Get Restaurant Names – Accept a HTTP GET request for all names of the
restaurants in the restaurant_review.xml file, returns an array of restaurant names.

 Update a Restaurant Review – Accept a HTTP PUT request for updating a


restaurant review in the restaurant_review.xml file. The HTTP request body
contains Restaurant object of the updated restaurant review data in the form of
json string.

 Save a Restaurant Review – Response to a HTTP POST request for saving a


new restaurant review to the restaurant_review.xml file. The HTTP request body
contains Restaurant object of the new restaurant review data in the form of json

CST8259 Web Programming Language II Page 1


Algonquin College, School of Advanced Technology

string. For simplicity, the new restaurant review write to the xml file will only
contain the data in the RestaurantInfo object,

 Delete a Restaurant Review – Accept a HTTP DELETE request with a


restaurant review’s id to delete the restaurant review in the restaurant_review.xml
indexed by the given id.

3. User Postman, or any Restful Web API Test client of your choice, to test Post, Put,
and Delete methods of RestaurantServiceAPI.

CST8259 Web Programming Language II Page 2

You might also like