Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple (even lacking) web server for debugging clients (yes, really).
import json
from werkzeug.wrappers import Request, Response
@Request.application
def application(request):
print('HEADERS:')
for header, value in request.headers.items():
print('{header}: {value}'.format(header=header, value=value))
print('CONTENT:')
print(json.dumps(request.values.to_dict()))
print('_'*80)
return Response('')
if __name__ == '__main__':
from werkzeug.serving import run_simple
run_simple('localhost', 4000, application)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.