contentType property
Content type
Implementation
CoapMediaType? get contentType {
final opt = getFirstOption(OptionType.contentFormat);
if (opt == null) {
return null;
}
return CoapMediaType.fromIntValue(opt.intValue);
}
Implementation
set contentType(final CoapMediaType? value) {
if (value == null) {
removeOptions(OptionType.contentFormat);
} else {
setOption(
CoapOption.createVal(OptionType.contentFormat, value.numericValue),
);
}
}