contentType property
MediaType
get
contentType
inherited
Gets or sets the content type to send back to a client.
It is the content-type header, parsed; text/plain if there is none,
or it does not parse.
Implementation
MediaType get contentType {
var header = headers['content-type'];
if (header == null) return _textPlain;
return _parsedContentTypes[header] ?? _parseContentType(header);
}
Gets or sets the content type to send back to a client.
Implementation
@override
set contentType(MediaType value) {
super.contentType = value;
if (!_streamInitialized) {
rawResponse.headers.contentType = ContentType(
value.type,
value.subtype,
parameters: value.parameters,
);
}
}