Reading-Notes

Reading Notes

How I explained REST to my brother

Who is Roy Fielding?

Architectural Styles and the Design of Network-based Software Architectures, Fielding’s doctoral dissertation, describes Representational State Transfer (REST) as a key architectural principle of the World Wide Web and received a large amount of attention. Computer engineers frequently hold up REST as an approach to developing web services, as an alternative to other distributed-computing specifications such as SOAP. Fielding has also been heavily involved in the development of HTML and Uniform Resource Identifiers. Fielding co-founded the Apache HTTP Server project and was a member of the interim OpenSolaris Boards until he resigned from the community in 2008. He chaired the Apache Software Foundation for its first three years and sat on its board of directors until May 2014. https://en.wikipedia.org/wiki/Roy_Fielding

Why don’t the techniques that we use in this class work well when we need to be able to talk to all of the machines in the world?

Becase the protocols weren’t designed to be used that way.

What is the HTTP protocol that Fielding and his friends created?

Before HTTP, or Hypertext Transfer Protocol, computer users would type the word “get” and a Web address when they wanted information. Fielding belonged to a small Web community that revised the standard into an email-like format, allowing users to send and receive hypertext documents. By clicking on hyperlinks, they could browse through Web pages containing graphics, sounds, video and other multimedia. https://www.universityofcalifornia.edu/news/roy-fielding-stands-protocol

What does a GET do?

GET is a method used to retrieve data from the server. This a read-only method so it does no mutating.

What does a POST do?

POST is a method that sends data to the server and creates a new resource, which will be a child to the original parent resource.

What does PUT do?

PUT is the method most often used to update and existing resource.

What does PATCH do?

The PATCH method is very similar to the PUT method because it also modifies an existing resource. The difference is that for the PUT method, the request body contains the complete new version, whereas for the PATCH method, the request body only needs to contain the specific changes to the resource, specifically a set of instructions describing how that resource should be changed, and the API service will create a new version according to that instruction.

All of the last four questions were referenced from:

https://medium.com/@9cv9official/what-are-get-post-put-patch-delete-a-walkthrough-with-javascripts-fetch-api-17be31755d28