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

Constructs a 500 Internal Server Error response.

This indicates that the server had an internal error that prevented it from fulfilling the request.

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.internalServerError({body, Map<String, String> headers,
    Encoding encoding, Map<String, Object> context})
    : this(500,
          headers: body == null ? _adjustErrorHeaders(headers) : headers,
          body: body == null ? 'Internal Server Error' : body,
          context: context);