import hmac
import json
import tornado.httpclient
-import tornado.gen
import urllib.parse
from .misc import Object
return h.hexdigest()
- @tornado.gen.coroutine
- def send_request(self, path, **kwargs):
+ async def send_request(self, path, **kwargs):
url = urllib.parse.urljoin(self.url, path)
# Query arguments are all keyword arguments
)
# Send the request
- response = yield self.backend.http_client.fetch(request)
+ response = await self.backend.http_client.fetch(request)
# Decode the JSON response
- d = json.loads(response.body.decode())
-
- raise tornado.gen.Return(d)
+ return json.loads(response.body.decode())