Skip to content

Commit

Permalink
[examples] update httpx client example (fixes: aiortc#190)
Browse files Browse the repository at this point in the history
The httpcore API has changed, and `arequest` is now
`handle_async_request`.
  • Loading branch information
jlaine committed Jul 7, 2021
1 parent d84349f commit 4ee21a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/httpx_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def __init__(self, *args, **kwargs):
self._read_queue: Dict[int, Deque[H3Event]] = {}
self._read_ready: Dict[int, asyncio.Event] = {}

async def arequest(
async def handle_async_request(
self,
method: bytes,
url: Tuple[bytes, bytes, Optional[int], bytes],
headers: Headers = None,
stream: httpcore.AsyncByteStream = None,
ext: dict = None,
extensions: dict = None,
) -> Tuple[int, Headers, httpcore.AsyncByteStream, dict]:
stream_id = self._quic.get_next_available_stream_id()
self._read_queue[stream_id] = deque()
Expand Down Expand Up @@ -76,7 +76,7 @@ async def arequest(
headers,
response_stream,
{
"http_version": "HTTP/3",
"http_version": b"HTTP/3",
},
)

Expand Down

0 comments on commit 4ee21a0

Please sign in to comment.