mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-11-04 00:46:43 +00:00 
			
		
		
		
	
		
			Some checks failed
		
		
	
	Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2s
				
			Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Waiting to run
				
			Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 6m59s
				
			Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 7m7s
				
			Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 5m14s
				
			Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 5m42s
				
			Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 4m51s
				
			Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 7m12s
				
			Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 6m33s
				
			Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 8m12s
				
			Ruff Lint / Ruff Lint (push) Successful in 43s
				
			Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 6m56s
				
			Site Deploy / publish (push) Failing after 7m21s
				
			
		
			
				
	
	
	
		
			1.7 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.7 KiB
		
	
	
	
	
	
	
	
mdx, sidebar_position, description
| mdx | 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