I have been learning more about REST API. Currently I have been working on backend implementation. Working on this is somewhat difficult. I understand how to implement new endpoints to get certain objects, but I have trouble in other things. It mostly has to do with the current homework.
So, I decided to learn more about it. I went to a blog from Stack Overflow since it is well known for having useful information about coding. If you need a question answered or a working piece of code you go there. I have used it before, and it was helpful. Hopefully, by the end I get a better understanding of the material and can utilize that newfound knowledge in the homework.
I used this: Best practices for REST API design – Stack Overflow
The article discusses the best practices for REST API design. It discusses using logical nesting to group associated information, and handling errors gracefully. It also discusses allowing filtering, sorting and paginating data. They are utilized to help deal with large data by only outputting the data that is needed. Let’s say there is 400 pieces of data and you only need 4%. By filtering, you can get that 4% without dealing with a slowdown and having to parse through data to see the 4%. The article also discusses versioning APIs, maintaining good security practices, caching data and minor things like using nouns instead of verbs in endpoints. It also discusses the importance of JSON and how it can be used for transferring data.
There is useful information but the one that stood out to me was the one about filtering, sorting and paginating data. There is a part of my homework that requires filtration. I need to make sure that when guest age is called, depending on the way GET is structured the resulting list is greater than, less than or equivalent to the chosen value. That section in the article gave me an idea. Like the example given in that section, I could use an if statement to filter out results. This may get the result I want.
To conclude, this article has been really useful to me. It has helped me understand what I have to do for a part of my homework assignment. It was interesting to learn ways to improve my REST API design. I may not know if you I will use this information in the future, but I know that I will use it now.
From the blog CS@Worcester – My Journey through Comp Sci by Joanna Presume and used with permission of the author. All other rights reserved by the author.
