Async tornado client¶
Implements an async tornado client class to query the Deezer API
- class deezer.contrib.tornado.AsyncClient(*args, **kwargs)¶
An async client to retrieve some basic infos about Deezer resources.
Create a client instance with the provided options. Options should be passed in to the constructor as kwargs.
>>> from deezer.contrib.tornado import AsyncClient >>> client = AsyncClient(app_id='foo', app_secret='bar')
This client provides several method to retrieve the content of most sort of Deezer objects, based on their json structure.
- request(method: str, path: str, parent: Optional[deezer.resources.Resource] = None, resource_type: Optional[Type[deezer.resources.Resource]] = None, **params)¶
Make a request to the API and parse the response.
method – HTTP verb to use: GET, POST< DELETE, …
path – The path to make the API call to (e.g. ‘artist/1234’).
parent – A reference to the parent resource, to avoid fetching again.
resource_type – The resource class to use as top level.
params – Query parameters to add the the request