Skip to content
Snippets Groups Projects

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
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading