Simple functions for reading requests and writing responses.