 }
 
 extension Client {
-    private func addHeaders(request: inout Request) {
+    private func addHeaders(_ request: inout Request) {
         var request = request
         request.host = "\(host):\(port)"
         request.userAgent = "Zewo"

}

extension Client {
    public func sendMethod(method: Method, uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(method, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func sendMethod(method: Method, uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(method, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    public func get(uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(.get, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func get(uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(.get, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    public func post(uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(.post, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func post(uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(.post, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    public func put(uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(.put, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func put(uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(.put, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    public func patch(uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(.patch, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func patch(uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(.patch, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    public func delete(uri: String, headers: Headers = [:], body: Data = [], middleware: Middleware...) throws -> Response {
        return try sendMethod(.delete, uri: uri, headers: headers, body: body, middleware: middleware)
    }

    public func delete(uri: String, headers: Headers = [:], body: DataConvertible, middleware: Middleware...) throws -> Response {
        return try sendMethod(.delete, uri: uri, headers: headers, body: body, middleware: middleware)
    }
}

extension Client {
    private func sendMethod(method: Method, uri: String, headers: Headers = [:], body: Data = [], middleware: [Middleware]) throws -> Response {
        let request = try Request(method: method, uri: uri, headers: headers, body: body)
        return try send(request, middleware: middleware)
    }

    private func sendMethod(method: Method, uri: String, headers: Headers = [:], body: DataConvertible, middleware: [Middleware]) throws -> Response {
        let request = try Request(method: method, uri: uri, headers: headers, body: body)
        return try send(request, middleware: middleware)
    }

        }
    }

    public func send(_ request: Request, middleware: Middleware...) throws -> Response {
        var request = request
        addHeaders(&request)
        return try middleware.chain(to: self).respond(to: request)
    }

    private func send(_ request: Request, middleware: [Middleware]) throws -> Response {
        var request = request
        addHeaders(&request)
        return try middleware.chain(to: self).respond(to: request)
