fix: Encode body and update resp.body

The patch sets the encoded body to resp.body so that other functions /
calls using it can operate on the updated value, which is the one that
will be sent back to the client.

fixes #158