The standard library module http.server already has 2 request handlers, with SimpleHTTPRequestHandler and CGIHTTPRequestHandler, the first serves files from a directory, and the second executes CGI scripts.
Two new handlers could be included in the standard library : - WebhookRequestHandler : Would spin up an HTTP server that one could connect webhooks to. Webhooks are really useful when dealing with APIs. So far, the third-party package, requests, is used when interacting with Web APIs, but there is nothing in the standard library that implements the webhook standard. - APIRequestHandler : This can be more controversial, especially with third-party packages like Flask, starlette, and django that will be much more powerful and secure than this, but this handler would be used to spin up a server that would make it easy to serve a simple restful API. I have already implemented both handlers in pure python (without third-party packages obviously), I'm just wondering if it's a good idea to make it a PEP, and implement these handlers as part of the python standard library.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/5UMEFDRKU5BXVVZ7HRULMQXVL7CTKX5L/ Code of Conduct: http://python.org/psf/codeofconduct/