MCPcopy Create free account
hub / github.com/LibraryOfCongress/api.congress.gov / __call__

Method __call__

api_client/python/cdg_client.py:24–32  ·  view source on GitHub ↗
(self, endpoint, *args, **kwargs)

Source from the content-addressed store, hash-verified

22 self._method = getattr(parent._session, http_method)
23
24 def __call__(self, endpoint, *args, **kwargs): # full signature passed here
25 response = self._method(
26 urljoin(self._parent.base_url, endpoint), *args, **kwargs
27 )
28 # unpack
29 if response.headers.get("content-type", "").startswith("application/json"):
30 return response.json(), response.status_code
31 else:
32 return response.content, response.status_code
33
34
35class CDGClient:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected