contentType property

CoapMediaType? contentType
inherited

Content type

Implementation

CoapMediaType? get contentType {
  final opt = getFirstOption<ContentFormatOption>();
  if (opt == null) {
    return null;
  }

  return CoapMediaType.fromIntValue(opt.value);
}
void contentType=(CoapMediaType? value)
inherited

Implementation

set contentType(final CoapMediaType? value) {
  if (value == null) {
    removeOptions<ContentFormatOption>();
  } else {
    setOption(ContentFormatOption(value.numericValue));
  }
}