Lines Matching +full:response +full:- +full:timeout
7 SPDX-License-Identifier: Apache-2.0
25 self.timeout = 10
37 def handle_response(resp: requests.models.Response): argument
39 Handle the response received from the server.
42 - response: The response object received from the server.
45 - dict: The parsed JSON response as a dictionary.
48 - Exception: If the response indicates an error condition.
59 params = {'timeout': self.timeout}
62 resp = self._s.get(f'{self.api_url}{path}', params=params, timeout=self.timeout)
67 …lf._s.put(f'{self.api_url}{path}', data=data, headers=headers, params=params, timeout=self.timeout)
74 …return self.put_raw(f'{path}?timeout={self.timeout}&format={self.format}' + uri_options, data=data…
81 headers={'content-type': 'application/json'}
82 uri_options = f'?timeout={self.timeout}&format={self.format}'
86 …lf._s.post(f'{self.api_url}{path}' + uri_options, data=data, headers=headers, timeout=self.timeout)
91 resp = self._s.delete(f'{self.api_url}{path}', timeout=self.timeout)
108 rid = path.split('/')[-1]
112 """Send LwM2M Write-Attributes to given path
119 """Send LwM2M Write-Attributes to given path
139 path = '/'.join(path.split('/')[:-1]) # Create call should not have instance ID in path
148 - value: The value to be converted.
151 - str: The string representation of the value.
178 "id": int(path.split('/')[-1]), # ID is last element of path
254 """Send LwM2M READ command and decode the response to a Python dictionary"""
271 """Decode the Leshan's response to composite query back to a Python dictionary"""
312 'timeout': self.timeout
321 """Send LwM2M Composite-Read command and decode the response to a Python dictionary"""
323 …elf._s.get(f'{self.api_url}/clients/{endpoint}/composite', params=parameters, timeout=self.timeout)
329 Send LwM2m Composite-Write operation.
349 level = len(path.split('/')) - 1
350 rid = int(path.split('/')[-1])
362 …f'{self.api_url}/clients/{endpoint}/composite', params=parameters, json=data, timeout=self.timeout)
366 …e_response(self._s.get(f'{self.api_url}/clients/{endpoint}/{path}/discover', timeout=self.timeout))
403 …st(f'{self.api_url}/clients/{endpoint}/composite/observe', params=parameters, timeout=self.timeout)
416 def get_event_stream(self, endpoint: str, timeout: int = None):
426 If timeout happens, the event streams returns None.
428 if timeout is None:
429 timeout = self.timeout
430 ….api_url}/event?{endpoint}', stream=True, headers={'Accept': 'text/event-stream'}, timeout=timeout)
432 r.encoding = 'utf-8'
434 yield LeshanEventsIterator(r, timeout)
440 def __init__(self, req: requests.Response, timeout: int): argument
443 self._timeout = timeout
449 If timeout happens, the returns None.
451 timeout = time.time() + self._timeout
465 if time.time() > timeout:
467 except requests.exceptions.Timeout: