Staging instance, all changes can be removed at any time

Skip to content

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


Migrated from D992 (view on Phabricator)

Merge request reports

Loading