 
         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
         }
     }

        }
    }

    private func getConnection() throws -> Connection {
        if let connection = self.connection {
            return connection
        }

        let connection: Connection

        if secure {
            connection = try TCPTLSConnection(
                host: host,
                port: port,
                verifyBundle: verifyBundle,

public enum HTTPClientError : Error {
    case invalidURIScheme
    case uriHostRequired
