Contents
- Header alteration
- Case insensitivity
- Content length
- Testing
At the end of lesson 5, we turned this HTTP response
HTTP/1.1 200 OK Content-Type: text/plain; charset=us-ascii Content-Length: 7 Hello!\n
into this Haskell expression:
Response
StatusLine http_1_1 status200 reasonOK)
(
[plainTextAsciiHeader,7 :: Integer)]
contentLengthHeader (Just (asciiMessageBody "Hello!\n")) (
There’s one more thing we want to improve: Let’s leave off that Content-Length
header and have a function that adds it automatically.