contentType property

MediaType contentType

Gets or sets the content type to send back to a client.

Implementation

MediaType get contentType {
  try {
    return MediaType.parse(headers['content-type']);
  } catch (_) {
    return MediaType('text', 'plain');
  }
}
void contentType= (MediaType value)

Gets or sets the content type to send back to a client.

Implementation

set contentType(MediaType value) {
  headers['content-type'] = value.toString();
}