Response.notFound(body, {Map<String, String> headers, Encoding encoding, Map<String, Object> context})

Constructs a 404 Not Found response.

This indicates that the server didn't find any resource matching the requested URI.

body is the response body. It may be a String, a Stream>, or null. If it's a String, encoding is used to encode it to a Stream>. The default encoding is UTF-8. If it's null or not passed, a default error message is used.

If encoding is passed, the "encoding" field of the Content-Type header in headers will be set appropriately. If there is no existing Content-Type header, it will be set to "application/octet-stream".

Source

Response.notFound(body, {Map<String, String> headers, Encoding encoding,
  Map<String, Object> context})
    : this(404,
        headers: body == null ? _adjustErrorHeaders(headers) : headers,
        body: body == null ? 'Not Found' : body,
        context: context);