ResponseHelpers extension
A set of extensions on the HttpResponse object, mostly for convenience
- on
Methods
-
json(
Object? json) → FutureOr - Helper method for those used to res.json()
-
send(
Object? data) → FutureOr - Helper method to just send data;
-
setContentTypeFromExtension(
String extension) → void - Set the content type from the extension ie. 'pdf'
-
setContentTypeFromFile(
File file) → void - Set the content type given a file
-
setDownload(
{required String filename}) → void - Set the appropriate headers to download the file
-
status(
int value) → HttpResponse