MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / api_get

Method api_get

scripts/migrate_wordpress.py:108–118  ·  view source on GitHub ↗
(self, endpoint: str, params: Optional[dict] = None)

Source from the content-addressed store, hash-verified

106 }
107
108 def api_get(self, endpoint: str, params: Optional[dict] = None) -> Optional[object]:
109 url = f"{self.site_url}/wp-json/wp/v2/{endpoint}"
110 try:
111 resp = self.session.get(url, params=params, timeout=30)
112 if resp.status_code == 400:
113 return None
114 resp.raise_for_status()
115 return resp.json()
116 except requests.RequestException as e:
117 print(f" ERROR fetching {url}: {e}")
118 return None
119
120 def get_all_docs(self) -> List[dict]:
121 """Fetch all published docs with pagination."""

Callers 1

get_all_docsMethod · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected