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

Constructs a 403 Forbidden response.

This indicates that the server is refusing to fulfill 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.forbidden(body, {Map<String, String> headers,
    Encoding encoding, Map<String, Object> context})
    : this(403,
        headers: body == null ? _adjustErrorHeaders(headers) : headers,
        body: body == null ? 'Forbidden' : body,
        context: context);