Skip to content

@igorgue /blog.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
import json
def allowed_methods(request):
return ['HEAD', 'GET', 'PUT', 'DELETE', 'POST']
def content_types_provided(request):
return {'text/html': to_html, 'text/plain': to_text, 'application/json': to_json}
def is_authorized(request):
return True
def to_html(request):
return "<h1>Hello, World!</h1>"
def to_text(request):
return "Hello, World!"
def to_json(request):
return json.dumps({'message': "Hello, World!"})
# XXX
from werkzeug.wrappers import Request, Response
@Request.application
def hello_world(request):
# 1. The allowed methods
if not request.method in allowed_methods():
raise Exception("Fuck")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.