extension Client { public func perform<Response>(request: Request<Response>) -> Future<Response, Error> where Response: Decodable { return Future<Response, Error> { [weak self] promise in self?.perform(request: request) { switch $0 { case .success(let response): promise(.success(response.body)) case .failure(let error): promise(.failure(error)) } } } } }