code: def is_json(self):
          
          mt = self.mimetype
          return (
              mt == "application/json"
              or mt.startswith("application/")
              and mt.endswith("+json")
          )
docs: Check if the mimetype indicates JSON data, either
          :mimetype:`application/json` or :mimetype:`application/*+json`.