fergalwalsh / pico

Pico is a very small web application framework for Python.
http://pico.readthedocs.io/
186 stars 41 forks source link

why don't we let people choose the status code? #10

Closed tatterdemalion closed 9 years ago

tatterdemalion commented 9 years ago

This is the only way that i found to set the status code for a request.

import pico

def teapot():
    try:
        brew_coffee()
        return "Smells nice!"
    except TeapotError:
        raise PicoError("I'm a teapot", status=418)
fergalwalsh commented 9 years ago

Makes sense, thanks @tatterdemalion!