code: def rmdir(self, pathobj):
          
          stat = self.stat(pathobj)
  
          if not stat.is_dir:
              raise OSError(20, "Not a directory: '%s'" % str(pathobj))
  
          url = str(pathobj) + '/'
  
          text, code = self.rest_del(url, session=pathobj.session, verify=pathobj.verify, cert=pathobj.cert)
  
          if code not in [200, 202, 204]:
              raise RuntimeError("Failed to delete directory: '%s'" % text)
docs: Removes a directory