caterva2.Client.subscribe#

Client.subscribe(root)#

Subscribes to a specified root.

Parameters:

root (str) – Name of the root to subscribe to.

Returns:

Server response as a string.

Return type:

str

Examples

>>> import caterva2 as cat2
>>> client = cat2.Client('https://demo.caterva2.net')
>>> root_name = 'h5numbers_j2k'
>>> client.subscribe(root_name)
'Ok'
>>> client.get_roots()[root_name]
{'name': 'h5numbers_j2k', 'http': 'localhost:8011', 'subscribed': True}