Using Rest API in class while working with our in-class and homework assignments has helped me understand backend development in a practical way. Vaibhav Kandwal’s blog, “REST API Tutorial – REST Client, REST Service, and API Calls Explained With Code Examples” does a really good job of simplifying and giving a top-down overview of what it looks like. Throughout my semester in Software Construction, Design, and Architecture I’ve learned a lot about Rest APIs but Kandwal’s way of breaking it down has deepened my understanding further.
One of the biggest points made in the blog is that Rest APIs are built around the idea of resources. Instead of being stuffed full of complicated actions, everything instead becomes a resource that can be created, retrieves, updated, and deleted. This makes endpoints easy to understand as when you see something like /guests you know what to expect. GET gets the data, POST adds something new, PUT or PATCH updates it, and DELETE removes it. REST reduces the guesswork by having a consistent structurer to follow.
The blog also heavily emphasizes that REST APIs are stateless. I wasn’t entirely sure why this was the case at first but after reading through it makes sense now. “Statelessness: the communication should have no client context stored on server. This means each request to the server should be made with all the required data and no assumptions should be made if the server has any data from previous requests.” The reason this is so important is scaling becomes much easier. The server doesn’t have to store anything about the previous requests. This also has the added benefit of system reliability. When the server doesn’t have to keep track of any previous conversations, there are fewer opportunities for unexpected bugs. This creates a safer and well-organized approach.
This connects directly with what we’ve worked with in class. One of our more recent homework assignments was created the endpoints in the Specification.yaml file and it was easy to see how each one followed the same structure with minor differences depending on the requirements for that endpoint. We decide what our resources are, what each endpoint should do, and what kind of data each operation should accept or return. Having that structure laid out before me has increased my understanding of the backend logic and made it much easier when it finally came time to write the JavaScript.
Overall, after reading this article I have a deeper understanding or REST APIs, and I plan to take this with me into my future career. I will certainly need this knowledge next semester when I take my Software Development Capstone course but also after I graduate seeing as how I have my sights set on being a software developer.
From the blog CS@Worcester – DPCS Blog by Daniel Parker and used with permission of the author. All other rights reserved by the author.
