code: def request(self, **kwargs):
          
  
          self.prepare_request(**kwargs)
          refresh_count = 0
  
          while True:
              self.log_request()
  
              try:
                  self.transport.request()
              except error.GrabError as ex:
                  self.exception = ex
                  self.reset_temporary_options()
                  if self.config['log_dir']:
                      self.save_failed_dump()
                  raise
              else:
                  doc = self.process_request_result()
  
                  if self.config['follow_location']:
                      if doc.code in (301, 302, 303, 307, 308):
                          if doc.headers.get('Location'):
                              refresh_count += 1
                              if refresh_count > self.config['redirect_limit']:
                                  raise error.GrabTooManyRedirectsError()
                              else:
                                  url = doc.headers.get('Location')
                                  self.prepare_request(
                                      url=self.make_url_absolute(url),
                                      referer=None)
                                  continue
  
                  if self.config['follow_refresh']:
                      refresh_url = self.doc.get_meta_refresh_url()
                      if refresh_url is not None:
                          refresh_count += 1
                          if refresh_count > self.config['redirect_limit']:
                              raise error.GrabTooManyRedirectsError()
                          else:
                              self.prepare_request(
                                  url=self.make_url_absolute(refresh_url),
                                  referer=None)
                              continue
                  return doc
docs: Perform network request.
  
          You can specify grab settings in ``**kwargs``.
          Any keyword argument will be passed to ``self.config``.
  
          Returns: ``Document`` objects.