summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/basic_engine.py21
1 files changed, 21 insertions, 0 deletions
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<dict>:
+ 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]
+