CoapRequest

class CoapRequest(val method: CoapCode, val uri: CoapUri, val options: OptionSet = OptionSet.EMPTY, payload: ByteArray = ByteArray(0), val isConfirmable: Boolean = true)(source)

A request as the client application states it: method, target URI, further options and the whole body. The client turns the URI into Uri-* options (RFC 7252 §6.4), splits a large body into Block1 transfers and assigns token and Message ID. Immutable; build one with Builder or the client's method shortcuts. Two requests are equal when method, URI, options, body (by content) and isConfirmable are, as two CoapResponses are by their parts.

Constructors

Link copied to clipboard
constructor(method: CoapCode, uri: CoapUri, options: OptionSet = OptionSet.EMPTY, payload: ByteArray = ByteArray(0), isConfirmable: Boolean = true)

Types

Link copied to clipboard
class Builder(val method: CoapCode, val uri: CoapUri)

Builds a CoapRequest.

Properties

Link copied to clipboard

whether the request goes in a Confirmable message (RFC 7252 §4.2) or a Non-confirmable one (§4.3): a hint for datagram transports only, since a reliable transport has no message types and ignores it (RFC 8323 §3.2).

Link copied to clipboard
Link copied to clipboard

options besides those the URI gives, such as Accept or Content-Format.

Link copied to clipboard

The whole body; a copy.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

A builder starting from this request.

Link copied to clipboard
open override fun toString(): String