| Conditions | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | #!/usr/bin/python |
||
| 17 | def api_request(self, api_url: str, params: dict = None, headers: dict = None) -> APIResponse: |
||
| 18 | """Insert API key and OTP code to the payload and return the parsed response |
||
| 19 | |||
| 20 | :type api_url: str |
||
| 21 | :type params: dict |
||
| 22 | :type headers: dict |
||
| 23 | :return: |
||
| 24 | """ |
||
| 25 | if headers is None: |
||
| 26 | headers = {} |
||
| 27 | if params is None: |
||
| 28 | params = {} |
||
| 29 | |||
| 30 | link = self._session.get(url=api_url, params=params, headers=headers) |
||
| 31 | |||
| 32 | return APIResponse(link.text) |
||
| 33 |