Table Of Contents

Next topic

QuickStart for people in a hurry

This Page

Welcome to Cornice’s documentation!

Cornice provides helpers to build & document REST-ish Web Services with Pyramid, with decent default behaviors.

Show me some code !

A full Cornice WGSI application looks like this (this example is taken from the demoapp project)

What Cornice will do for you here is:

  • automatically raise a 405 if a DELETE or a PUT is called on /{username}/info
  • automatically generate your doc via a Sphinx directive.
  • provide a validation framework that will return a nice JSON structure in Bad Request 400 responses explaining what’s wrong.
  • provide an acceptable Content-Type whenever you send an HTTP “Accept” header to it, resulting in a 406 Not Acceptable with the list of acceptable ones if it can’t answer.

You can also have a complete overview of the builtin validations provided by cornice in Built-in features

Contribution & Feedback

Cornice is a project initiated at Mozilla Services, where we build Web Services for features like Firefox Sync. All of what we do is built with open source, and this is one brick of our stack.

We welcome Contributors and Feedback!