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

Method put

src/bcf/bcf/v3/bcfapi.py:194–210  ·  view source on GitHub ↗
(self, endpoint: str, data: Any = None, params: Any = None)

Source from the content-addressed store, hash-verified

192 return response.status_code, response.reason
193
194 def put(self, endpoint: str, data: Any = None, params: Any = None) -> tuple[int, str]:
195 headers = {
196 "Authorization": f"Bearer {self.foundation_client.get_access_token()}",
197 "Content-type": "application/json",
198 }
199
200 try:
201 response = requests.put(
202 f"{self.baseurl}{endpoint}", headers=headers, params=params or None, data=data or None
203 )
204
205 if response.status_code != 200:
206 response.raise_for_status()
207 return response.status_code, response.text
208 except requests.exceptions.HTTPError as errh:
209 print(f"message: {response.reason}' '{response.status_code}, {errh}")
210 return response.status_code, response.reason
211
212 def delete(self, endpoint: str, params: Any = None) -> tuple[int, str]:
213 headers = {

Callers 15

update_topicMethod · 0.95
update_filesMethod · 0.95
update_commentMethod · 0.95
update_related_topicsMethod · 0.95
escape_for_turtleFunction · 0.80
serializeFunction · 0.80
write_paddingFunction · 0.80
format_entity_instanceFunction · 0.80
descendFunction · 0.80
format_tasksFunction · 0.80
finalizeFunction · 0.80

Calls 2

printFunction · 0.85
get_access_tokenMethod · 0.45

Tested by

no test coverage detected