nerdexam
Cisco

200-901 · Question #236

Refer to the exhibit. The script returns an output of 401. To use the supplied URL. an HTTP GET request must Be sent with an Authorization header. The header value is a BaseG4 encoded concatenation…

The correct answer is B. Modify the method from LOGIN to GET and supply the username ;password value as JSON. A 401 Unauthorized response means the server rejected the authentication attempt. The exhibit shows the script uses an incorrect HTTP method (not GET) when calling the endpoint. HTTP Basic Authentication requires the method to be GET and the Authorization header to contain…

Understanding and Using APIs

Question

Refer to the exhibit. The script returns an output of 401. To use the supplied URL. an HTTP GET request must Be sent with an Authorization header. The header value is a BaseG4 encoded concatenation of the username and password. Which action must be taken to return an output of 200?

Exhibit

200-901 question #236 exhibit

Options

  • AChange the verify=False setting in the request to verify=True to enable HTTP Basic
  • BModify the method from LOGIN to GET and supply the username ;password value as JSON
  • CVerify that the username and password values imported from the configuration file ate still valid.
  • DInsert an Authorization header with the values username password from the supplied

How the community answered

(20 responses)
  • A
    5% (1)
  • B
    85% (17)
  • C
    10% (2)

Explanation

A 401 Unauthorized response means the server rejected the authentication attempt. The exhibit shows the script uses an incorrect HTTP method (not GET) when calling the endpoint. HTTP Basic Authentication requires the method to be GET and the Authorization header to contain 'Basic <Base64(username:password)>'. Option B corrects both the HTTP method and the credential submission approach. Option A is wrong because verify=False/True controls TLS certificate verification, not authentication. Option C could help only if credentials expired, but the root cause here is the wrong method. Option D is the right concept but does not address the wrong HTTP method shown in the script.

Topics

#HTTP Status Codes#API Authentication#HTTP GET Request#Authorization Headers

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice