ResponseHelpers extension

A set of extensions on the HttpResponse object, mostly for convenience

on

Methods

json(Object? json) Future
Helper method for those used to res.json()
send(Object? data) Future
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