Lesson 4: Response encoding

  • Response
  • BSB.string7
  • foldMap
  • Status line
  • Exercise 1: Header fields
  • Exercise 2: Message body
  • 7 minutes

In lesson 3, we defined types that to represent HTTP requests and responses. The purpose of that was to be able to rewrite the simple server from lesson 2 so that we no longer have to write HTTP responses by hand. In this lesson, we write the function to convert a Response into a ByteString.

Sign up for access to the full page, plus the complete archive and all the latest content.