cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

JSONDecodeError in SDWAN API response in Python

hrmt92
Level 1
Level 1

I am automating a task via the SDWAN API and whenever I request a response from methods like get_device_config or export_device_template_list, I get below error.

 

result_json = json.loads(response.text)
File "C:\Users\htmc0583\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\htmc0583\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\htmc0583\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

The json that I am getting is not valid for some reason. Anybody faced the same issue and any solution to this?

Who Me Too'd this topic