-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
When i am testing an HTTPS endpoint. i am getting an inconsistent response. Some times i am getting correct response sometimes i am getting below error. its pretty random..
httpx.RemoteProtocolError: <StreamReset stream_id:1, error_code:ErrorCodes.INTERNAL_ERROR, remote_reset:True> Fatal error on SSL transport protocol: <asyncio.sslproto.SSLProtocol object at 0x000002377FC0D2B0> transport: <_ProactorSocketTransport fd=360 read=<_OverlappedFuture cancelled>> AttributeError: 'NoneType' object has no attribute 'send' Exception ignored in: <function _SSLProtocolTransport.__del__ at 0x000002377FB3F3A0>
Below is my code
import httpx
r = httpx.Client(http2=True,verify=False)
response = r.post('https://aws-xxx.us-east-1.elb.amazonaws.com/version')
print(response.text)
I also tried using AsyncClient below is the code for it
import httpx
import asyncio
# r = httpx.AsyncClient(http2=True,verify=False)
async def testfun():
async with httpx.AsyncClient(http2=True, verify=False) as client:
r = await client.post('https://aws-xxx.us-east-1.elb.amazonaws.com/version')
print(r)
asyncio.run(testfun())
I have tested this in my pycharm environment with python verion 3.8.0. Let me know if you need any further information.