code: def get_url(self, resource, params=None):
          
  
          # replace placeholders
  
          pattern = r'\{(.+?)\}'
  
          resource = re.sub(pattern, lambda t: str(params.get(t.group(1), '')), resource)
  
          # build url
  
          parts = (self.endpoint, '/api/', resource)
          return '/'.join(map(lambda x: str(x).strip('/'), parts))
docs: Generate url for request