Loading

发送http2请求

有时服务器会检测http协议版本,有http/1.1和h2,requests发送的是http1.1的请求

# pip install httpx

client = httpx.Client(http2=True, headers=headers)
client.get(url, headers=headers)  # get请求
client.post(url)  # post请求

 

posted @ 2022-09-13 08:20  hkwJsxl  阅读(76)  评论(0编辑  收藏  举报