preconditionsHold

fun preconditionsHold(currentETag: ByteArray?, exists: Boolean = currentETag != null): Boolean(source)

Evaluates If-Match and If-None-Match (RFC 7252 §5.10.8) against the resource's current state. A handler that returns 4.12 Precondition Failed when this is false, and lists both options in CoapResource.recognizedOptions, implements conditional requests.

Parameters

currentETag

the ETag of the current representation, if any.

exists

whether the target resource currently has a representation.