 
         do {
             // TODO: Add deadline to serializer
-            try serializer.serialize(request)
+            // TODO: Deal with multiple responses
+
+            try serializer.serialize(request, deadline: requestDeadline)
             
             var response: Response!
-            while !connection.closed {
-                let chunk = try connection.read(upTo: bufferSize, deadline: requestDeadline)
-                try parser.parse(chunk) { message in
+            while !stream.closed {
+                let chunk = try stream.read(upTo: bufferSize, deadline: requestDeadline)
+                for message in try parser.parse(chunk) {
                     response = message as! Response
                 }
             }
 
             if let upgrade = request.upgradeConnection {
-                try upgrade(response, connection)
+                try upgrade(response, stream)
             }
 
             if response.isError || !keepAlive {
-                self.connection = nil
+                self.stream = nil
             }
 
             return response
         } catch let error as StreamError {
-            self.connection = nil
+            self.stream = nil
             throw error
         }
     }

                deadline: now() + connectionTimeout
            )
        } else {
            connection = try TCPConnection(
                host: host,
                port: port,
                deadline: now() + connectionTimeout
            )
        }

        try connection.open(deadline: now() + connectionTimeout)
        return connection
    }

    private func getSerializer(connection: Connection) -> RequestSerializer {
        if let serializer = serializer {
            return serializer
        }
        return RequestSerializer(stream: connection)
    }

    private func getParser(connection: Connection) -> MessageParser {
        if let parser = self.parser {
            return parser
        }

public enum HTTPClientError : Error {
    case invalidURIScheme
    case uriHostRequired
