discogs_aio_spider icon indicating copy to clipboard operation
discogs_aio_spider copied to clipboard

我在使用Httpx的过程中遇到问题

Open rainzee opened this issue 3 years ago • 0 comments

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

rainzee avatar Mar 18 '22 07:03 rainzee