nerdexam
CiscoCisco

200-901 · Question #477

200-901 Question #477: Real Exam Question with Answer & Explanation

The correct answer is A: get(uri,headers = headers,data={}, verify-True). Retrieving device inventory data from the Cisco DNA Center API requires an HTTP GET request with SSL verification enabled for secure communication.

Understanding and Using APIs

Question

Refer to the exhibit. A software engineer needs to collect data about devices that are registered in Cisco DNA Center using the API. Before collecting the data, the engineer must obtain a token and authenticate with the API. To automate the procedure, a Python script is used. Which code snippet must be placed onto the blank in the code?

Options

  • Aget(uri,headers = headers,data={}, verify-True)
  • Bpost(uri,headers=headers,data={}, verify=False)
  • Cget(uri,headers= headers,data={}, verify=False)
  • Dpost(uri,headers=headers,data={"Basic"}, verify=False)

Explanation

Retrieving device inventory data from the Cisco DNA Center API requires an HTTP GET request with SSL verification enabled for secure communication.

Common mistakes.

  • B. POST is used to create or submit data (such as requesting an auth token), not to retrieve existing device records from the DNA Center inventory API endpoint.
  • C. GET is the correct method, but 'verify=False' disables SSL certificate validation, which introduces a security risk by allowing man-in-the-middle attacks and is not recommended for production use.
  • D. Passing a literal 'Basic' string as the request body data is incorrect; Basic Auth credentials are encoded in the Authorization request header, not the body, and POST is not the appropriate method for data retrieval.

Concept tested. Cisco DNA Center REST API GET request with SSL verification

Reference. https://developer.cisco.com/docs/dna-center/#!cisco-dna-2-3-7-x-api-overview

Topics

#Python requests library#API authentication#HTTP methods#Cisco DNA Center API

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions