QuestionQ19

VerifiedUnderstanding and Using APIs

Question Image

Refer to the exhibit. A developer needs to use a token to collect data from the Cisco DNA Center API and prepares a Python script to send requests. Which line of code must be placed in the missing portion of the snippet to obtain a token from the Cisco DNA Center API?

Explanation

Cisco DNA Center’s token endpoint uses HTTP Basic authentication. With HTTPBasicAuth imported from requests.auth, the POST request must pass auth=HTTPBasicAuth(user,password) as its authentication argument; the final parenthesis closes requests.post.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!