【文件属性】:
文件名称:Nego:每个 Web 框架的内容协商
文件大小:9KB
文件格式:ZIP
更新时间:2021-07-18 16:55:49
Python
尼戈
每个 Web 框架的内容协商实用程序。
HTTP 媒体类型
Nego 提供抽象的 HTTP 媒体类型。
主类型和子类型
MediaType类解析原始媒体类型字符串并将其拆分为主/子类型。
>>> from nego import MediaType
>>> MediaType( ' text/html ' )
nego.MediaType('text/html')
>>> MediaType( ' text/html ' ).main_type
'text'
>>> MediaType( ' text/html ' ).sub_type
'html'
>>> MediaType( ' application ' , ' json ' )
nego.MediaType('application/json')
参数
MediaType类也解析参数。
>>> MediaType( '
【文件预览】:
Nego-master
----nego()
--------renderer.py(4KB)
--------media_type.py(5KB)
--------__init__.py(265B)
----.gitignore(3KB)
----README.rst(4KB)
----tests()
--------test_content_negotiation.py(3KB)
--------__init__.py(0B)
--------test_mediatype.py(3KB)
----setup.py(340B)
----tox.ini(325B)