text method
Implementation
Future<HttpResponse> text([dynamic data]) async {
// Only the essentials
response.headers.contentType = ContentType.text;
response.headers.contentLength = utf8.encode(data).length;
response.headers.set(HttpHeaders.connectionHeader, 'keep-alive');
response.persistentConnection = true;
// Optional: Cache-control is good for performance
response.headers.set(HttpHeaders.cacheControlHeader, 'public, max-age=300');
return response
..statusCode = HttpStatus.ok
..write(data)
..close();
}