ServerResponse.notModified constructor
ServerResponse.notModified({})
Creates a 304 Not Modified conditional response.
Implementation
factory ServerResponse.notModified({
String? etag,
DateTime? lastModified,
String? cacheControl,
Map<String, String>? headers,
}) {
return ServerResponse(
statusCode: 304,
headers: {
if (etag != null) 'ETag': etag,
if (lastModified != null)
'Last-Modified': lastModified.toUtc().toIso8601String(),
if (cacheControl != null) 'Cache-Control': cacheControl,
if (headers != null) ...headers,
},
body: '',
);
}