class_docstr: Interactive Handler.
class_docstr_tok: ["Interactive","Handler","."]
docstr: Handle POST.
docstr_tok: ["Handle","POST","."]
code: def do_POST(self):
      """
      Handle POST.
      """
      if self.path != "/interact":
          return self.respond({"status": 500})
      ctype, pdict = cgi.parse_header(self.headers["content-type"])
      pdict["boundary"] = bytes(pdict["boundary"], "utf-8")
      postvars = cgi.parse_multipart(self.rfile, pdict)
      model_response = self.interactive_running(postvars)
  
      self.send_response(200)
      self.send_header("Content-type", "application/json")
      self.end_headers()
      json_str = json.dumps(model_response)
      self.wfile.write(bytes(json_str, "utf-8"))
  
imports: from http.server import BaseHTTPRequestHandler, HTTPServer
  from parlai.scripts.interactive import setup_args
  from parlai.core.agents import create_agent
  from parlai.core.worlds import create_task
  from parlai.core.image_featurizers import ImageLoader
  from typing import Dict, Any
  import json
  import cgi
  import PIL.Image
  from base64 import b64decode
  import io
  import os
label_desc: Use image node_id 3 for calling the MyHandler obj's underlying member method code with example usage: obj.do_POST() and returns: self