Implementing Cisco Enterprise Network Core Technologies (350-401 ENCOR) Exam Materials - Question #169 Discussion

Comment Image Comment Image Comment Image
Question Diagram

Refer to the exhibit. Which two modifications are required so that the configuration fetched from the device is saved as a valid JSON-encoded file? (Choose two answers)

  • A. Add
    with open("config.json","w") as OutFile: OutFile.write(response.json)
    at the end of the script
  • B. Add
    headers={"Accept":"application/yang-data+json"},
    as a parameter to the requests.get() call
  • C. Add
    with open("config.json","w") as OutFile: OutFile.write(response.text)
    at the end of the script
  • D. Add
    headers={"Accept":"application/yang-data+xml"},
    as a parameter to the requests.get() call
  • E. Add
    json = True,
    as a parameter to the requests.get() call
Correct Answer: B,C

Brave-Dump Community Votes

Answer: B, C (2 votes) 66.67%
Answer: B, E (1 vote) 33.33%

Community Explanations & Comments (3)

Anonymous User 2 months ago
Selected: B, E
Its B and E
Brave-Dumps.com Admin 2 months ago
can you explain why? Cisco RESTCONF supports application/yang-data+json for returning YANG data in JSON format. The Requests documentation shows that response.text contains the response body as text, while response.json() converts it into a Python object. Option A incorrectly uses response.json without parentheses and attempts to write it directly.
Anonymous User 1 month ago
Selected: B, C
B make the request to return a JSON response and C take the response.text which is already in JSON format and write/save it to a file.
Anonymous User 2 weeks ago
Selected: B, C
B & C