nabto_client_coap_set_request_payload()

DESCRIPTION

Set payload and content format for the payload.

The payload is copied into the request object.

DECLARATION

NABTO_CLIENT_DECL_PREFIX NabtoClientError NABTO_CLIENT_API
nabto_client_coap_set_request_payload(NabtoClientCoap* coap, uint16_t contentFormat, const void* payload, size_t payloadLength)

PARAMETERS

coap:
[in] The CoAP request to set request payload and content format on.
contentFormat:
[in] See https://www.iana.org/assignments/core-parameters/core-parameters.xhtml, some often used values are defined in NabtoClientCoapContentFormat.
payload:
[in] Data for the request encoded as specified in the contentFormat parameter.
payloadLength:
[in] Length of the payload in bytes.

RETURNS

Returns NABTO_CLIENT_OK if the payload and content format were successfully set.