ExamGecko
Question list
Search
Search

Question 209 - 200-901 discussion

Report
Export

Refer to the exhibit.

A developer creates a script to obtain a list of devices by using the Cisco DNA Center API. The remote server authorizes the request only if an authentication token is supplied in the headers. A function named get_auth_token() must retrieve a valid token by using HTTP Basic Authentication. Which code must be added to complete the get_auth_token() function?

A.

resp = requests.post(url, auth=HTTPBasicAuth(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

Answers
A.

resp = requests.post(url, auth=HTTPBasicAuth(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

B.

resp = requests.post(url, auth=(DNAC_USER, DNAC_PASSWORD)) token = resp.json ()['Token'] return token

Answers
B.

resp = requests.post(url, auth=(DNAC_USER, DNAC_PASSWORD)) token = resp.json ()['Token'] return token

C.

resp = http.post(url, auth=HTTPBasicAuth(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

Answers
C.

resp = http.post(url, auth=HTTPBasicAuth(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

D.

resp = http.post(url, auth=(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

Answers
D.

resp = http.post(url, auth=(DNAC_USER, DNAC_PASSWORD)) token = resp.json()['Token'] return token

Suggested answer: A
asked 07/10/2024
Storage Junk
48 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first