Replace httpx and httpx-sse with httpx2 (#2972)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
This commit is contained in:
parent
1216c53693
commit
2713b53b12
2 changed files with 1029 additions and 948 deletions
|
|
@ -7,7 +7,7 @@ contribution kinds: tools, resources, new request methods, and one `tools/call`
|
|||
interceptor. The server never hands itself to an extension; the extension
|
||||
declares what it adds, and the server consumes it.
|
||||
|
||||
The shape follows the HTTPX `Transport`/`Auth` pattern: a narrow base class whose
|
||||
The shape follows the httpx2 `Transport`/`Auth` pattern: a narrow base class whose
|
||||
methods have sensible defaults, so an extension overrides only what it needs. A
|
||||
purely additive extension (Apps) overrides `tools`/`resources`; an interceptive
|
||||
one overrides `methods`/`intercept_tool_call`.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from typing import Any
|
|||
|
||||
import anyio
|
||||
import anyio.to_thread
|
||||
import httpx
|
||||
import httpx2
|
||||
import pydantic
|
||||
import pydantic_core
|
||||
from mcp_types import Annotations, Icon, InputRequiredResult
|
||||
|
|
@ -170,7 +170,7 @@ class HttpResource(Resource):
|
|||
|
||||
async def read(self) -> str | bytes:
|
||||
"""Read the HTTP content."""
|
||||
async with httpx.AsyncClient() as client: # pragma: no cover
|
||||
async with httpx2.AsyncClient() as client: # pragma: no cover
|
||||
response = await client.get(self.url)
|
||||
response.raise_for_status()
|
||||
return response.text
|
||||
|
|
|
|||
Loading…
Reference in a new issue