CoapRequest.executeAsync() Overload 1

DESCRIPTION

Execute a CoAP request asynchronously.

The specified closure is invoked when the response is ready or an early error occurs.

If a response is available, the first parameter in the CoapResponseReceiver closure invocation is OK and the second parameter is set to the created CoapResponse.

If an early error occurs, the first parameter is set to an appropriate NabtoEdgeClientError and the second parameter is nil.

DECLARATION

    public func executeAsync(closure: @escaping CoapResponseReceiver) 

PARAMETERS

closure:
invoked when async operation completes

Overload 2

DESCRIPTION

Execute a CoAP request asynchronously..

When the function returns, the CoapResponse object is populated with response data and ready to use. The response can indicate a remote error. If an error occurs that prevents creating a response with a status code, an exception is thrown.

DECLARATION

    public func executeAsync() async throws -> CoapResponse 

THROWS ERRORS

NabtoEdgeClientError:
if a response could not be created