class_docstr: Handle HTTP requests.
class_docstr_tok: ["Handle","HTTP","requests","."]
docstr: Handle POST request, especially replying to a chat message.
docstr_tok: ["Handle","POST","request",",","especially","replying","to","a","chat","message","."]
code: def do_POST(self):
      """
      Handle POST request, especially replying to a chat message.
      """
      if self.path == "/interact":
          content_length = int(self.headers["Content-Length"])
          body = self.rfile.read(content_length)
          self._interactive_running(body)
          self.send_response(200)
          self.send_header("Content-type", "application/json")
          self.end_headers()
          model_response = {"id": "Model", "episode_done": False}
          message_available.wait()
          model_response["text"] = new_message
          message_available.clear()
          json_str = json.dumps(model_response)
          self.wfile.write(bytes(json_str, "utf-8"))
      elif self.path == "/reset":
          self._interactive_running(b"[RESET]")
          self.send_response(200)
          self.send_header("Content-type", "application/json")
          self.end_headers()
          self.wfile.write(bytes("{}", "utf-8"))
          message_available.wait()
          message_available.clear()
      else:
          return self._respond({"status": 500})
  
imports: import json
  import websocket
  import threading
  from parlai.core.params import ParlaiParser
  from parlai.scripts.interactive_web import WEB_HTML, STYLE_SHEET, FONT_AWESOME
  from http.server import BaseHTTPRequestHandler, HTTPServer
label_desc: Use image node_id 3 for calling the BrowserHandler obj's underlying member method code with example usage: obj.do_POST() and returns: self