Refer to the exhibit. What is the result of the Python script?
A.
It uses the POST HTTP method to obtain a username and password to be used for authentication.
B.
It uses the POST HTTP method to obtain a token to be used for authentication.
C.
It uses the GET HTTP method to obtain a token to be used for authentication.
D.
It uses the GET HTTP method to obtain a username and password to be used for authentication
The Answer Is:
B
This question includes an explanation.
Explanation:
The Python script is using the dnac_login function to authenticate to a Cisco DNA Center server and obtain a token that can be used for subsequent API calls. The function takes three parameters: host, username, and password. It constructs a URL for the authentication endpoint, which is https://{}/api/system/v1/auth/token. It then uses the requests library to send a POST HTTP request to the URL, passing the username and password as HTTP Basic Authentication credentials, and setting the headers to indicate the expected content type and response format. The function also disables the SSL verification by setting the verify parameter to False. This is not recommended for production environments, as it exposes the script to potential security risks. The function then returns the token value from the JSON response, which is accessed by using the response.json()[ "Token"] syntax. The token can then be used as a bearer token for subsequent API calls to the Cisco DNA Center server. References:
Implementing and Operating Cisco Security Core Technologies (SCOR) v1.0, Module 9: Content Security, Lesson 9.3: Cisco DNA Center APIs
Cisco DNA Center Platform API Reference, Authentication API
Refer to the exhibit. What will happen when the Python script is executed?
350-701 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"