300-435 · Question #153
Refer to the exhibit. A network engineer creates a Python script to retrieve event messages from Cisco vManage by using the Cisco Catalyst SD-WAN vManage API. After the messages are retrieved, they…
The correct answer is B. Correct the link to the requested resource. A Python JSONDecodeError indicates the HTTP response body is not valid JSON, which is caused by an incorrect resource URL returning an error page or non-JSON content.
Question
Options
- ASpecify the values of the variables that refer to the metrics.
- BCorrect the link to the requested resource.
- CUse pagination with the query.
- DChange the authentication credentials.
How the community answered
(30 responses)- A10% (3)
- B73% (22)
- C13% (4)
- D3% (1)
Why each option
A Python JSONDecodeError indicates the HTTP response body is not valid JSON, which is caused by an incorrect resource URL returning an error page or non-JSON content.
Unspecified metric variable values would cause a Python NameError or KeyError, not a JSONDecodeError during response parsing.
When the URL path to the vManage API resource is incorrect, the server returns an HTML error page or a non-JSON error response instead of the expected JSON payload. Calling response.json() on such a response triggers a JSONDecodeError because the content cannot be parsed as JSON. Correcting the URL to point to the proper API endpoint ensures a valid JSON response is returned.
Pagination issues would result in truncated or partial data but would still return valid JSON - they would not cause a JSONDecodeError.
Incorrect authentication credentials would return an HTTP 401 response, which vManage returns as JSON - this would not cause a JSONDecodeError.
Concept tested: Diagnosing JSONDecodeError from incorrect API URL
Source: https://developer.cisco.com/docs/sdwan/
Topics
Community Discussion
No community discussion yet for this question.