Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add support for v1 API endpoints and DigestAuth #67

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Apply suggestions from code review
agners authored Nov 24, 2023
commit 139bb38313d842dc7992ab9f1a80e827d37b2b5f
3 changes: 1 addition & 2 deletions pyprusalink/client.py
Original file line number Diff line number Diff line change
@@ -58,12 +58,11 @@ def _extract_digest_params(self, headers: dict[str]) -> None:

@asynccontextmanager
async def request(
self, method: str, path: str, json_data: dict | None = None,
self, method: str, path: str, json_data: dict | None = None,
try_auth: bool = True
) -> AsyncGenerator[ClientResponse, None]:
"""Make a request to the PrusaLink API."""
url = f"{self.host}{path}"

headers = self._generate_headers(method=method, path=path)
async with self._session.request(
method, url, json=json_data, headers=headers