code: def ajax(self, url, method="GET", data=None, headers=None):
          
          params = {
              "method": method,
              "url": self.url_prefix + url,
              "headers": headers
          }
          if data is not None:
              if method in ["GET", "DELETE"]:
                  params["params"] = data
              elif method in ["POST", "PUT", "PATCH"]:
                  params["json"] = data
          resp = self.session.request(**params)
          if self.auth_header in resp.headers:
              self.session.headers[
                  self.auth_header] = resp.headers[self.auth_header]
          return resp_json(resp)
docs: Send request