IPWorks IoT 2020 Python Edition

Questions / Feedback?

send_response Method

Sends a response for a given pending request to the corresponding client.

Syntax

def send_response(request_id: str) -> None: ...

Remarks

This method sends a response for the request in the PendingRequest* properties identified by RequestId. The response_data property specifies the data that will be sent in the response, and the response_code property specifies the response code. If the response_content_format and/or response_e_tag properties are non-empty, their values will be used to include Content-Format and Etag options in the response (respectively). Any additional options present in the ResponseOption* properties will be included as well.

If the use_confirmable_messages property is enabled when this method is called, the class will automatically retransmit the response message (if necessary) until it receives confirmation from the client that it was received. Note that the retransmission period is not infinite; eventually the class will assume that the message is undeliverable and time out the response. The on_response_complete event will fire once the message receipt is confirmed (or once the retransmission period elapses).

If the use_confirmable_messages property is disabled, the on_response_complete event will fire immediately instead, since there is no way to know whether the client received the response.

Note: This method can only be called when the class is operating in server mode (i.e., when the listening property is enabled).

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Python Edition - Version 20.0 [Build 8265]