From 26c9c0e8be632e91523b946d709e2752fe4c0441 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Tue, 15 Oct 2013 00:19:25 +0200 Subject: [PATCH] [enh] examples added --- examples/basic_engine.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/basic_engine.py diff --git a/examples/basic_engine.py b/examples/basic_engine.py new file mode 100644 index 000000000..1ed5a3388 --- /dev/null +++ b/examples/basic_engine.py @@ -0,0 +1,21 @@ + +def request(query, params): + '''pre-request callback + params: + method : POST/GET + headers : {} + data : {} # if method == POST + url : '' + ''' + + params['url'] = 'https://host/%s' % query + + return params + + +def response(resp): + '''post-response callback + resp: requests response object + ''' + return [resp.text] +