I am new to Python and want to build an application that can accept a certain number of HTTP requests, then go on to parse these requests and process the data stored in the body.
I have found a lot of tutorials for REST APIs and ways to create servers that will indefinitely accept incoming requests, however, it does not seem like good practice to me to start such a server then force stop it after a short amount of time. In addition, I need to compare data within request bodies to determine when to stop accepting requests, and I had trouble storing data between request handler calls using Flask.
My question is this:
What is a good practice for accepting HTTP requests in Python, where the amount of requests to be received depends on the data in each request body (such that when this requirement is met, the program can stop accepting connections and go on to process the stored request data)