【文件属性】:
文件名称:bottle-api:在Bottle Web框架开发上构建WebAPI的有用装饰器
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-11 06:00:19
Python
瓶装api
安装
$ pip install bottle-api
基本用法
json_endpoint装饰器将为JSON WebAPI端点提供一个功能。 装饰的函数将返回bottle.HTTPResponse。
请参阅以下示例网络应用程序:
#!python
from bottleapi import WebApiError
from bottleapi.jsonapi import json_endpoint
from bottle import Bottle, request
app = Bottle()
@json_endpoint
def devide():
a = int(request.params['a'])
b = int(request.params['b'])
if b == 0:
raise WebApiError('b
【文件预览】:
bottle-api-master
----MANIFEST.in(28B)
----README.rst(1KB)
----LICENSE(1KB)
----setup.py(564B)
----tests()
--------test_jsonapi.py(5KB)
--------test_general.py(1KB)
----.gitignore(97B)
----bottleapi()
--------jsonapi.py(4KB)
--------__init__.py(695B)