我正在创建一个REST api,我必须将json值作为请求和响应处理
from bottle import route, run
@route('/recipes/<name>')
def recipes_list(name):
return name
run(host='localhost', port=8080, debug=True)
运行命令1:
curl http://localhost:8080/recipes/getstring
输出1:
getstring
运行命令2:
curl http://localhost:80s/getstrinc?p={"s":"get"}
输出2:
getstring
但预期产出
{"s":"get"}
s
get
如何以上述格式获得输出