Skip to content

Commit edf0675

Browse files
schloerketdstein
andcommitted
Use client to retrieve path
Co-Authored-By: Taylor Steinberg <[email protected]>
1 parent 08caf8d commit edf0675

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/posit/connect/system.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ def destroy(self, **kwargs) -> Task | None:
140140
task.wait_for()
141141
```
142142
"""
143-
url = self._ctx.url + self._path
144-
data = dict(self)
145-
response = self._ctx.session.delete(url, json={**data, **kwargs})
143+
body = {**self, **kwargs}
144+
response = self._ctx.client.delete(self._path, json=body)
146145

147146
task_id = response.json().get("task_id")
148147
if not task_id:
@@ -191,8 +190,7 @@ def find(self) -> List[SystemRuntimeCache]:
191190
runtime_caches = client.system.caches.runtime.find()
192191
```
193192
"""
194-
url = self._ctx.url + self._path
195-
response = self._ctx.session.get(url)
193+
response = self._ctx.client.get(self._path)
196194
results = response.json()
197195
if not isinstance(results, dict) and "caches" not in results:
198196
raise RuntimeError("`caches=` not found in response.")

0 commit comments

Comments
 (0)