patchBytes method

Future<CoapResponse> patchBytes(
  1. String path, {
  2. required Uint8Buffer payload,
  3. CoapMediaType? format,
  4. MatchEtags matchEtags = MatchEtags.onMatch,
  5. List<Uint8Buffer>? etags,
  6. CoapMediaType? accept,
  7. bool confirmable = true,
  8. List<CoapOption>? options,
  9. bool earlyBlock2Negotiation = false,
  10. int maxRetransmit = 0,
  11. CoapMulticastResponseHandler? onMulticastResponse,
})

Sends a PATCH request with the specified byte payload.

See RFC 8132, section 3.

Implementation

Future<CoapResponse> patchBytes(
  final String path, {
  required final Uint8Buffer payload,
  final CoapMediaType? format,
  final MatchEtags matchEtags = MatchEtags.onMatch,
  final List<Uint8Buffer>? etags,
  final CoapMediaType? accept,
  final bool confirmable = true,
  final List<CoapOption>? options,
  final bool earlyBlock2Negotiation = false,
  final int maxRetransmit = 0,
  final CoapMulticastResponseHandler? onMulticastResponse,
}) {
  final request = CoapRequest.newPatch(confirmable: confirmable)
    ..setPayloadMediaRaw(payload, format);
  _build(
    request,
    path,
    accept,
    options,
    earlyBlock2Negotiation,
    maxRetransmit,
    etags: etags,
    matchEtags: matchEtags,
  );
  return send(request, onMulticastResponse: onMulticastResponse);
}