code: def _handle_poll(self, relpath, params):
      
      request = json.loads(params.get('q')[0])
      ret = {}
      # request is a polling request for multiple files. For each file:
      #  - id is some identifier assigned by the client, used to differentiate the results.
      #  - path is the file to poll.
      #  - pos is the last byte position in that file seen by the client.
      for poll in request:
        _id = poll.get('id', None)
        path = poll.get('path', None)
        pos = poll.get('pos', 0)
        if path:
          abspath = os.path.normpath(os.path.join(self._root, path))
          if os.path.isfile(abspath):
            with open(abspath, 'rb') as infile:
              if pos:
                infile.seek(pos)
              content = infile.read()
              ret[_id] = content.decode("utf-8")
      content = json.dumps(ret).encode("utf-8")
      self._send_content(content, 'application/json')
docs: Handle poll requests for raw file contents.