Source Code

https://hook.io/examples/python-wsgi

These examples can be run directly in the browser or from any client which speaks HTTP.
You can also send data using tools like cURL.

Code

import pprint
import logging
import microcule

log = logging.getLogger('echo-py')

def app(environ, start_response):
    start_response('200 OK', [('content-type', 'text/plain')])
    res = ["Hello, this is a Python script."]
    res.append("Hook['params'] is populated with request parameters")
    res.append(pprint.pformat(Hook['params']))
    res.append("Hook['req'] is the http request")
    res.append(pprint.pformat(Hook['req']['url']))
    log.info('hello logs')
    log.warn('%s', Hook['params'])
    return '\n'.join(res)

if __name__ == '__main__':
    microcule.wsgi(Hook).run(app)

To make your own copy of this service or "Fork" it simply click the button. You will need to register for a Free Account, but it's very quick and easy!