httpx

Posted yzg-14

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了httpx相关的知识,希望对你有一定的参考价值。

使用简单方便,轻松实现异步请求的 HTTP 客户端

>>> import httpx
# 同步
>>> r = httpx.get(‘https://www.example.org/‘)
>>> r
<Response [200 OK]>
>>> r.status_code
# 异步
>>> async with httpx.AsyncClient() as client:
>>>     r = await client.get(‘https://www.example.org/‘)
>>> r
<Response [200 OK]>

  

以上是关于httpx的主要内容,如果未能解决你的问题,请参考以下文章