Summary
This chapter introduced us to HTTP, web servers, and the request-response interaction between a web server and a client. Multiple clients were introduced, including the most typical (the web browser) as well as curl
and clj-http
. We learned how a web server takes an incoming request and routes it according to key elements of the incoming request map, before constructing a response map, which is then presented to the requesting client.
We learned about middleware and how it intercepts our request and/or response map. We then used muuntaja
to format the content we generated for the client, as well as to format incoming data from the client as JSON or EDN.
After considering the content of our database in the context of groups of related resources, we learned how to construct appropriate paths to address them using a REST architecture. This paved the way for integrating our existing application layers with a web service that would allow any web client to interact with them...