import httpx url = "http://127.0.0.1:1313" data = "ww$$go" headers = { "Content-Type": "application/x-www-form-urlencoded", # 设置合适的 Content-Type } # 使用 httpx 发送 HTTP/2 POST 请求 with httpx.Client(http2=True) as client: response = client.post(url, data=data, headers=headers) # 输出响应信息 print(f"Status Code: {response.status_code}") print("Response Content:") print(response.text)