Contents
- The new server
- Exercise 1: Construct a response
- Response-constructing functions
- Status line
- Content type
- Content length
- Message body
- Exercise 2: Use the functions
Video
- 5 minutes
In lesson 4, we wrote a function for encoding our abstract representation of a Response
as a byte string suitable for transmission over a network according to the HTTP protocol.
encodeResponse :: Response -> BSB.Builder
Now we can rewrite our server so that the HTTP response it sends is constructed from a value of the Response
type.