Express
1. What’s the difference between PUT and PATCH?
-
PUT is a method of modifying resource where the client sends data that updates the entire resource. It is used to set an entity’s information completely.
-
Unlike PUT, PATCH applies a partial update to the resource. This means that you are only required to send the data that you want to update, and it won’t affect or change anything else. So if you want to update the first name on a database, you will only be required to send the first parameter; the first name.
2. Provide links to 3 services or tools that allow you to “mock” an API for development like json-server
3. Compare and contrast Swagger and APIDoc.js 1 Which HTTP status codes should be sent with each type of (un)successful API call?
responses: ‘200’: description: OK
'400':
description: Bad request. User ID must be an integer and larger than 0.
'401':
description: Authorization information is missing or invalid.
'404':
description: A user with the specified ID was not found.
'5XX':
description: Unexpected error.
4. Compare and contrast SOAP and ReST
The difference is:
-
SOAP is a XML-based message protocol, while REST is an architectural style
-
SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data
-
SOAP invokes services by calling RPC method, REST just simply calls services via URL path
-
SOAP doesn’t return human readable result, whilst REST result is readable with is just plain XML or JSON
-
SOAP is not just over HTTP, it also uses other protocols such as SMTP, FTP, etc, REST is over only HTTP
Document the following Vocabulary Terms
- Web Server
- A web server is the technology that serves up a website to users when they visit a URL. On the technical side of things, what that means is that it handles the hypertext transfer protocol (HTTP)
- Express
- Web Applications
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- Routing
- Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app’s executable endpoints. Endpoints are the app’s units of executable request-handling code. Endpoints are defined in the app and configured when the app starts. The endpoint matching process can extract values from the request’s URL and provide those values for request processing. Using endpoint information from the app, routing is also able to generate URLs that map to endpoint