Skip to content

HTTP2 post request response is inconsistent #1506

@Private-SO

Description

@Private-SO

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions