nonebot2/website/versioned_docs/version-2.3.1/api/drivers/httpx.md
noneflow[bot] 622e8e8af3 🔖 Release 2.3.1
2024-05-20 14:19:50 +00:00

1.7 KiB

sidebar_position description
3 nonebot.drivers.httpx 模块

nonebot.drivers.httpx

HTTPX 驱动适配

nb driver install httpx
# 或者
pip install nonebot2[httpx]

:::tip 提示 本驱动仅支持客户端 HTTP 连接 :::

class Session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)

  • 参数

    • params (QueryTypes)

    • headers (HeaderTypes)

    • cookies (CookieTypes)

    • version (str | HTTPVersion)

    • timeout (float | None)

    • proxy (str | None)

async method request(setup)

async method setup()

  • 参数

    empty

  • 返回

    • None

async method close()

  • 参数

    empty

  • 返回

    • None

class Mixin(<auto>)

  • 说明: HTTPX Mixin

  • 参数

    auto

async method request(setup)

method get_session(params=None, headers=None, cookies=None, version=HTTPVersion.H11, timeout=None, proxy=None)

  • 参数

    • params (QueryTypes)

    • headers (HeaderTypes)

    • cookies (CookieTypes)

    • version (str | HTTPVersion)

    • timeout (float | None)

    • proxy (str | None)

  • 返回

    • Session

class Driver(env, config)