+"""
+ status = '200 OK'
+ headers = [('Content-Type', 'text/html')]
+ start_response(status, headers)
+ return [response]
+
+ def do_post(self, env, start_response):
+ try:
+ request_size = int(env.get('CONTENT_LENGTH', 0))
+ except (ValueError):
+ request_size = 0
+ request = env['wsgi.input'].read(request_size)
+ client_address = env['REMOTE_ADDR']
+
+ try:
+ response = self.api.handle(client_address, request)
+ status = '200 OK'
+ headers = [('Content-Type', 'text/html')]
+ except:
+ response = "'<h1>Internal Server Error</h1>"
+ status = '500 Internal Server Error'
+ headers = [('Content-Type', 'text/html')]
+ logger.log_exc(status)
+
+ start_response(status, headers)
+ return [response]