IPWorks EDI 2020 Python Edition

Questions / Feedback?

send_response Method

In a server environment, responds to the requesting client with MDNReceipt .

Syntax

def send_response() -> None: ...

Remarks

When called from within a server environment, on_send_response will respond to the requesting client. If an MDN was requested, then mdn_receipt will be returned to the client, either in the HTTP response or in a separate transmission, depending on the client request. In case it is returned in a separate transmission, a simple acknowledgement of "200 OK" will also be sent in the HTTP response, unless this was sent previously using ack_request.

The AS2 headers will be taken from mdn_receipt and will be merged with HTTP headers as appropriate. Note that if receipt_delivery_option indicates a "mailto:" URL, the appropriate SMTP settings should be set using config.

The exact behavior of the method is specific to the environment. In ASP.NET, the receipt will be sent within the current HTTP context. In Java, the receipt will be sent within the provided HttpServletResponse. Otherwise, the receipt will be directed to stdout. If this is impossible, an exception will be thrown.

Optionally, if an asynchronous MDN is requested, the mdn_receipt and receipt_delivery_option may be saved so that the MDN may be sent later through the send_async_mdn method.

This method should only be invoked after mdn_receipt has been generated by create_mdn_receipt or process_request.

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