Reading notes for Code Fellows!
PUT and PATCH?According to MDN Web Docs, PUT and PATCH are both HTTP request methods. Request methods are often called HTTP verbs. They indicate a desired action to be performed for a given resource.
PUT - The PUT method replaces all current representations of the target resource with the request payload.PATCH - The PATCH method is used to apply partial modifications to a resource.According to Kristopher Sandoval’s article “10+ Tools To Mock HTTP Requests” on Nordic APIs website, mocking HTTP requests is a vital part of testing. These tools should be able to mock common API interactions and HTTP request flows. Various tools offer differing options and implementations.
| Swagger | APIDoc.js |
|---|---|
| creates documentation for API | creates documentation for API |
| requires that implemented methods be documented with custom comment data | requires that implemented methods be documented with custom comment data |
| uses OpenAPI specification to work | creates documentation from API annotations in source code |
| Swagger Documentation | APIDoc.js |
According to MDN Web Docs, HTTP response status codes are grouped into 5 classes:
100 - 199)200 - 299)300 - 399)400 - 499)500 - 599)The following information is derived from the 2017 Stackify article “SOAP vs. REST: The Differences and Benefits Between the Two Widely-Used Web Service Communication Protocols” by Alexandra Altvater.
SOAP was the standard approach to web service communication protocols for a long time but it has been dominated by REST in recent years. REST now represents over 70% of public APIs.
| SOAP | ReST |
|---|---|
| Simple Object Access Protocol | Representational State Transfer |
| performs operations through messaging patterns | simply accesses data |
| provides more robust security and support for identity verification | allows greater variety of data formats |
| offers built in logic to compensate for failed communications | generally considered easier to work with |
| Tends to be slower because it uses the complex XML format | generally faster and uses less bandwidth and easier to integrate with existing websites |
| Vocabulary Term | Definition | | — | — | | Web Server | A web server is a piece of software that often runs on a hardware server offering service to a user, usually referred to as the client MDN Web Docs | | Express | Express is the most popular Node web framework, and is the underlying library for a number of other popular Node web frameworks MDN Web Docs | | Routing | Routing is the mechanism by which requests are connected to some code. It is essentially the way you navigate through a website or web-application. Wilbert Schepenaar | | WRRC | ‘Web Request/Response Cycle’ The web is a cycle of requests and responses that flow between clients and servers. Jen Strong |
express.Router().next()