cannot receive data before headers #2133
Unanswered
rainzee
asked this question in
Potential Issue
Replies: 1 comment
-
|
My assumption here is that this is a server which is responding with an invalid HTTP/2 response. You might want to disable HTTP/2 for this case. An alternative to digging in further would be to attempt the request with an alternate client, such as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I keep getting this error when I try to construct the request, and after checking the official documentation, it said it's a missing necessary header, but I can debug it successfully using the browser.
What could be causing this error?
`import httpx
def getMatch():
header = {
'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.39'
}
client = httpx.Client(headers=header, http2=True, verify='riotgames.pem')
url = 'some_url'
request = httpx.Request("GET", url=url)
r = client.send(request)
print(r)
getMatch()`
httpx.LocalProtocolError: cannot receive data before headers
Beta Was this translation helpful? Give feedback.
All reactions