diff options
| author | omnom62 <omnom62@outlook.com> | 2026-05-31 07:25:03 +1000 |
|---|---|---|
| committer | omnom62 <omnom62@outlook.com> | 2026-05-31 07:25:03 +1000 |
| commit | 6a161ed8f263e152ebfd227e669a51773de5a028 (patch) | |
| tree | efd9cef101e459daa021b98ba00e5f75d897048e /plugins/httpapi | |
| parent | f37d4e313154ea7ea40250849549065196fab722 (diff) | |
| download | rest.vyos-6a161ed8f263e152ebfd227e669a51773de5a028.tar.gz rest.vyos-6a161ed8f263e152ebfd227e669a51773de5a028.zip | |
updated tests
Diffstat (limited to 'plugins/httpapi')
| -rw-r--r-- | plugins/httpapi/vyos.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/httpapi/vyos.py b/plugins/httpapi/vyos.py index 1719254..6dd6042 100644 --- a/plugins/httpapi/vyos.py +++ b/plugins/httpapi/vyos.py @@ -105,11 +105,15 @@ class HttpApi(HttpApiBase): Raises: ConnectionError: on HTTP error or VyOS success=false response. """ + try: api_key = self._get_api_key() - body = json.dumps(payload) - form_data = urlencode({"data": body, "key": api_key}) + if "_raw_list" in payload: + body = json.dumps(payload["_raw_list"]) + else: + body = json.dumps(payload) + form_data = urlencode({"data": body, "key": api_key}) response, response_data = self.connection.send( endpoint, data=form_data, |
