value property
String
value
Returns the corresponding MIME type string for the content type.
- ContentType.json is mapped to 'application/json'.
- ContentType.stream is mapped to 'application/octet-stream'.
- ContentType.bytes is mapped to 'application/octet-stream'.
- ContentType.text is mapped to 'text/plain'.
If the content type is not one of the above, it defaults to 'application/json'.
Implementation
String get value {
switch (this) {
case ContentType.json:
return 'application/json';
case ContentType.stream:
return 'application/octet-stream';
case ContentType.bytes:
return 'application/octet-stream';
case ContentType.text:
return 'text/plain';
default:
return 'application/json';
}
}