We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6e8e0e commit 18c6623Copy full SHA for 18c6623
pusher/urlfetch.py
@@ -0,0 +1,27 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from __future__ import (print_function, unicode_literals, absolute_import,
4
+ division)
5
6
+import urlfetch
7
+import json
8
+from pusher.http import process_response
9
10
+class URLFetchBackend(object):
11
+ """Adapter for the URLFetch Module. Necessary for using this library with Google
12
+ App Engine"""
13
14
+ def __init__(self, config, **options):
15
+ self.config = config
16
+ self.options = options
17
18
+ def send_request(self, request):
19
+ resp = urlfetch.fetch(
20
+ url=request.url,
21
+ headers=request.headers,
22
+ method=request.method,
23
+ data=request.body,
24
+ deadline=self.config.timeout,
25
+ **self.options
26
+ )
27
+ return process_response(resp.status_code, resp.content)
0 commit comments