This is part 2 of my rest service writing article. In part 1 we saw the library which holds the functionality we will be using, and we also handled the incoming request and captured all the data we'll be using.
In this second part she gets into the details behind the handle() method of the class. It splits the URL into its parts and, based on the action requested, hands it off to the right method and calls the output() method to return to the user. Some error handling is also included (with custom exceptions).