Skip to content

Commit 5be8069

Browse files
Using httpx2 library
1 parent 98963e9 commit 5be8069

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/http_client/faq_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
from typing import Any
22

3-
import httpx
3+
import httpx2
44

55
from app.config import settings
66

77

88
async def get_faqs() -> Any:
9-
async with httpx.AsyncClient() as client:
9+
async with httpx2.AsyncClient() as client:
1010
response = await client.get(f"{settings.app_external_faq_api_base_url}/faqs")
1111
return response.json()
1212

1313

1414
async def get_faqs_by_id(faq_id: int) -> Any:
15-
async with httpx.AsyncClient() as client:
15+
async with httpx2.AsyncClient() as client:
1616
response = await client.get(
1717
f"{settings.app_external_faq_api_base_url}/faqs/{faq_id}"
1818
)
1919
return response.json()
2020

2121

2222
def create_faq(faq: dict[str, Any]) -> Any:
23-
with httpx.Client() as client:
23+
with httpx2.Client() as client:
2424
response = client.post(
2525
f"{settings.app_external_faq_api_base_url}/faqs", json=faq
2626
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "Repository to learn and explore API and Backend service with Pyth
55
requires-python = ">=3.12"
66
dependencies = [
77
"fastapi[all]",
8+
"httpx2",
89
"sqlmodel",
910
"asyncpg",
1011
"structlog",
@@ -18,7 +19,6 @@ dependencies = [
1819
[dependency-groups]
1920
dev = [
2021
"flake8",
21-
"httpx2",
2222
"pytest",
2323
"pytest-mock",
2424
"pytest-html",

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)