ResponseHelpers extension

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

on

Methods

json(Object? json) FutureOr

Available on HttpResponse, provided by the ResponseHelpers extension

Helper method for those used to res.json()
send(Object? data) FutureOr

Available on HttpResponse, provided by the ResponseHelpers extension

Helper method to just send data;
setContentTypeFromExtension(String extension) → void

Available on HttpResponse, provided by the ResponseHelpers extension

Set the content type from the extension ie. 'pdf'
setContentTypeFromFile(File file) → void

Available on HttpResponse, provided by the ResponseHelpers extension

Set the content type given a file
setDownload({required String filename}) → void

Available on HttpResponse, provided by the ResponseHelpers extension

Set the appropriate headers to download the file
status(int value) HttpResponse

Available on HttpResponse, provided by the ResponseHelpers extension

ServerUniverseUncompleteDocumentation