postBytes method
Future<CoapResponse>
postBytes(
- String path, {
- required Uint8Buffer payload,
- CoapMediaType? format,
- CoapMediaType? accept,
- bool confirmable = true,
- List<
Option< ? options,Object?> > - bool earlyBlock2Negotiation = false,
- int maxRetransmit = 0,
- CoapMulticastResponseHandler? onMulticastResponse,
Sends a POST request with the specified byte payload.
Implementation
Future<CoapResponse> postBytes(
final String path, {
required final Uint8Buffer payload,
final CoapMediaType? format,
final CoapMediaType? accept,
final bool confirmable = true,
final List<Option<Object?>>? options,
final bool earlyBlock2Negotiation = false,
final int maxRetransmit = 0,
final CoapMulticastResponseHandler? onMulticastResponse,
}) {
final request = CoapRequest.newPost(confirmable: confirmable)
..setPayloadMediaRaw(payload, format);
_build(
request,
path,
accept,
options,
earlyBlock2Negotiation,
maxRetransmit,
);
return send(request, onMulticastResponse: onMulticastResponse);
}