200-901 · Question #377
Refer to the exhibit. A developer must use a token to collect data from Cisco DNA Center API and prepares a Python script to send requests. Which line of code needs to be placed on the snippet where…
The correct answer is C. auth=HTTPBasicAuth(user,password)). To obtain a token from the Cisco DNA Center API using HTTP Basic Authentication, the requests library in Python is used. The missing line of code in the snippet should set up HTTP Basic Authentication as follows: auth=HTTPBasicAuth(user,password) HTTPBasicAuth: This is a class…
Question
Refer to the exhibit. A developer must use a token to collect data from Cisco DNA Center API and prepares a Python script to send requests. Which line of code needs to be placed on the snippet where the code is missing to obtain a token from the Cisco DNA Center API?
Exhibit
Options
- Atoken=BasicAuth(
user',password')) - Bauth=BasicAuth(
user',password')) - Cauth=HTTPBasicAuth(user,password))
- Dtoken=HTTPBasicAuth(user,password))
How the community answered
(16 responses)- A6% (1)
- B13% (2)
- C75% (12)
- D6% (1)
Explanation
To obtain a token from the Cisco DNA Center API using HTTP Basic Authentication, the requests library in Python is used. The missing line of code in the snippet should set up HTTP Basic Authentication as follows: auth=HTTPBasicAuth(user,password) HTTPBasicAuth: This is a class from the requests.auth module that handles HTTP Basic user, password: These are the credentials required for authentication. The correct line of code that completes the script to obtain a token from Cisco DNA Center API is: auth=HTTPBasicAuth(user,password)
Topics
Community Discussion
No community discussion yet for this question.
