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

Method post

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

Source from the content-addressed store, hash-verified

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 = {
178 "Authorization": f"Bearer {self.foundation_client.get_access_token()}",
179 "Content-type": "application/json",
180 }
181
182 try:
183 response = requests.post(
184 f"{self.baseurl}{endpoint}", headers=headers, params=params or None, data=data or None
185 )
186
187 if response.status_code != 201:
188 response.raise_for_status()
189 return response.status_code, response.text
190 except requests.exceptions.HTTPError as errh:
191 print(f"message: {response.reason}' '{response.status_code}, {errh}")
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 = {

Callers 8

create_topicMethod · 0.95
create_commentsMethod · 0.95
create_viewpointsMethod · 0.95
loginMethod · 0.45
get_refresh_tokenMethod · 0.45
get_new_access_tokenMethod · 0.45
create_documentMethod · 0.45

Calls 2

printFunction · 0.85
get_access_tokenMethod · 0.45

Tested by

no test coverage detected