TypeError: no default __reduce__ due to non-trivial __cinit__ #2301
Answered
by
EssaAlshammri
EssaAlshammri
asked this question in
Potential Issue
-
|
Hello everyone ✋ when ever I instantiate an async client inside a context I get the following error TypeError: no default __reduce__ due to non-trivial __cinit__I'm trying to call an api from my fastapi app @some_router.get("/")
async def whatever():
async with httpx.AsyncClient() as client:
data = await client.get("https://httpbin.org/get")
return data.json()but when I do it this way all works fine @some_router.get("/")
async def whatever():
client = httpx.AsyncClient()
data = await client.get("https://httpbin.org/get")
await client.aclose()
return data.json() |
Beta Was this translation helpful? Give feedback.
Answered by
EssaAlshammri
Jul 12, 2022
Replies: 1 comment
-
|
never mind I wasn't returning the response properly |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lovelydinosaur
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
never mind I wasn't returning the response properly