MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get

Method get

src/bcf/bcf/v3/bcfapi.py:163–174  ·  view source on GitHub ↗
(self, endpoint: str, params: Any = None, is_auth_required: bool = False)

Source from the content-addressed store, hash-verified

161 self.baseurl = version["api_base_url"]
162
163 def get(self, endpoint: str, params: Any = None, is_auth_required: bool = False) -> Any:
164 # TODO: handle error http status codes and raise exception. Follow error.json standard.
165 headers = {"Authorization": f"Bearer {self.foundation_client.get_access_token()}"}
166
167 response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
168 try:
169 response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None)
170 if response.status_code == 200:
171 return response.json()
172 response.raise_for_status()
173 except requests.exceptions.HTTPError as e:
174 print(f"message: {response.reason}' '{response.status_code}' '{ e }")
175
176 def post(self, endpoint: str, data: Any = None, params: Any = None) -> tuple[int, str]:
177 headers = {

Callers 15

get_projectsMethod · 0.95
get_projectMethod · 0.95
get_extensionsMethod · 0.95
get_topicMethod · 0.95
get_files_informationMethod · 0.95
get_filesMethod · 0.95
get_commentMethod · 0.95
get_viewpointsMethod · 0.95
get_viewpointMethod · 0.95
get_snapshotMethod · 0.95
get_bitmapMethod · 0.95
get_selectionMethod · 0.95

Calls 2

printFunction · 0.85
get_access_tokenMethod · 0.45

Tested by

no test coverage detected