Add support for content negotiation in swh's API
Using these 2 negotiate formatters, it is possible to write Flask endpoints as: from flask import Flask from negotiate.flask import negotiate from swh.core.api import JSONFormatter, MshpackFormatter app = Flask() @app.route('/somewhere') @negotiate(MsgpackFormatter) @negotiate(JSONFormatter) def somewhere(): return {'some': 'content'} See https://github.com/nickstenning/negotiate
parent
24f9d5ee
No related branches found
No related tags found
... | ... | @@ -8,3 +8,4 @@ PyYAML |
requests | ||
Flask | ||
systemd-python | ||
negotiate |
Please register or sign in to comment