Summary
In this chapter, I demonstrated how the HTTP features provided by Node.js and enhanced by the Express package, can be used to create a RESTful web service.
- The HTTP request URL identifies the data and the HTTP method denotes the operation that will be performed.
- The JSON format is used by most web services, which has replaced XML as the default data format.
- There is little standardization in the way that web services are implemented, although there are some common conventions that are widely used, particularly relating to the operations that HTTP methods represent.
- The data received by web services must be validated before it can be safely used.
- Web services are most easily written by separating the implementation from the code that handles HTTP requests and performs validation.
In the next chapter, I will demonstrate how HTTP requests can be authenticated and how the user’s identity can be used for authorization.