You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
auto/demo/demo_httpx_sync.py

14 lines
339 B

# -*- coding: utf-8 -*-
import httpx
def sync_get_example():
# 使用 httpx 发送 GET 请求
response = httpx.get('https://httpbin.org/get')
# 打印状态码和响应内容
print(f"Status Code: {response.status_code}")
print(f"Response Content: {response.text}")
if __name__ == "__main__":
sync_get_example()