Override the __init__ of BaseHTTPRequestHandler in python

Currently, I am writing some python program for the front of our storage system. By using ‘BaseHTTPRequestHandler’ and ‘ThreadedHTTPServer’, we could implement a simple multi-thread http server quickly. But after add ‘__init__()’ for our ‘MyHandler’, it doesn’t work correctly now:

Then I found this statement in python docs:

But thanks for the code example, we could override ‘__init__’ of BaseHTTPRequestHandler’ this way:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.