toResponse method

Response toResponse({
  1. int status = 200,
})

Render and return a Shelf Response

Implementation

shelf.Response toResponse({int status = 200}) {
  final html = render();
  return shelf.Response(
    status,
    headers: {'Content-Type': 'text/html; charset=utf-8'},
    body: html,
  );
}