WSGI with RESTful post-processing
I implemented a solution by creating a new Python thread and attaching the second transaction to it. To ensure it kicks of after the first transaction, i put a small delay in the thread before it starts the second transaction.  Hoping there are no issues introduced with threading.
We have a WSGI application with Python3 running under Apache Linux.
We want to interact with an external API after acknowledging a request / notification received via the Web server
Sample WSGI python code:

def application(environ, start_response):
    path=  environ.get('PATH_INFO', '')   
    if path == "/ProcessTransact":
        import sys
        sys.stderr.write("Entering /ProcessTransact, Checking validity ...\n" )
        # Get the context of the notification/request from Post parameters etc, assume it is a valid ...
        status = '200 OK'  
        body = b"Acknowledge the valid submit with '200 OK'"
        response_headers = [
            ('Content-Type', 'text/html'),
            ('Content-Length', str(len(body)))
        ]

        start_response(status, response_headers)
        return [body]

        # we have acknowledged the context of the above request
        # we want to do an HTTP POST based on the context 
        # When we return [body], we lost the processing thread

        import requests           #or maybe something else
        sys.stderr.write("POST RESTful transactions here after acknowledging the request (we never get here).\n") 

Our code is slightly different to the sample code (using Werkzeug).
What is the best way to solve this?
We are purposefully not using any frameworks (except Werkzeug) and we want to avoid large changes in architecture (thousands of lines of code)
Thank you,
Kris