【问题标题】:httpx.RemoteProtocolError: peer closed connection without sending complete message bodyhttpx.RemoteProtocolError: peer closed connection without sending complete message body
【发布时间】:2022-12-04 08:16:33
【问题描述】:

尽管将 httpx 调用的超时设置为无,但我仍收到上述错误。我不确定我做错了什么。

from httpx import stream

with stream("GET", url, params=url_parameters, headers=headers, timeout=None) as streamed_response:

【问题讨论】:

    标签: python httpx


    【解决方案1】:

    通过 openapi-client 自动生成的客户端使用 httpx 时,我遇到了同样的错误

    response = httpx.request(verify=client.verify_ssl,**kwargs,)
    

    原来在kwargs范围标题包含错误的授权令牌。 所以基本上在我的情况下,错误意味着“授权错误”。 您可能想检查您在参数中发送的内容是否也正确。

    【讨论】:

      猜你喜欢
      • 2020-12-18
      • 1970-01-01
      • 2019-11-04
      • 1970-01-01
      • 1970-01-01
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 2019-02-02
      相关资源
      最近更新 更多