code: def query(self,
                url,
                method='GET',
                extra_params=None,
                extra_headers=None,
                retry=3,
                raw=False,
                stream=False):
          
          response = None
          loop = 0
  
          # always make sure the headers and params are clean
          self.cleanup_headers()
  
          while loop <= retry:
  
              # override request.body or request.headers dictionary
              if extra_params:
                  params = self.__params
                  params.update(extra_params)
              else:
                  params = self.__params
              _LOGGER.debug("Params: %s", params)
  
              if extra_headers:
                  headers = self.__headers
                  headers.update(extra_headers)
              else:
                  headers = self.__headers
              _LOGGER.debug("Headers: %s", headers)
  
              _LOGGER.debug("Querying %s on attempt: %s/%s", url, loop, retry)
              loop += 1
  
              # define connection method
              req = None
  
              if method == 'GET':
                  req = self.session.get(url, headers=headers, stream=stream)
              elif method == 'PUT':
                  req = self.session.put(url, json=params, headers=headers)
              elif method == 'POST':
                  req = self.session.post(url, json=params, headers=headers)
  
              if req and (req.status_code == 200):
                  if raw:
                      _LOGGER.debug("Required raw object.")
                      response = req
                  else:
                      response = req.json()
  
                  # leave if everything worked fine
                  break
  
          return response
docs: Return a JSON object or raw session.
  
          :param url:  Arlo API URL
          :param method: Specify the method GET, POST or PUT. Default is GET.
          :param extra_params: Dictionary to be appended on request.body
          :param extra_headers: Dictionary to be apppended on request.headers
          :param retry: Attempts to retry a query. Default is 3.
          :param raw: Boolean if query() will return request object instead JSON.
          :param stream: Boolean if query() will return a stream object.