nerdexam
Cisco

200-901 · Question #204

A developer is creating a script to interact with a REST API service which requires basic authentication. The credentials are "devnet:391665405" and the Base64 encoding of the credentials is…

The correct answer is B. payload = { } headers= { 'Authorization' : 'Basic GV2bmV0dXNlcjpDaXNj=', 'Content-Type' : 'application/json' }. HTTP Basic Authentication requires the Authorization header in the format: 'Basic <base64-encoded-credentials>'. The keyword 'Basic' signals to the server that the credential string is a Base64-encoded username:password pair. Options C and D use 'Bearer' instead of 'Basic'…

Understanding and Using APIs

Question

A developer is creating a script to interact with a REST API service which requires basic authentication. The credentials are "devnet:391665405" and the Base64 encoding of the credentials is "GV2bmV0dXNlcjpDaXNj=". Which payload and header combination must be used for authentication? A. B. C. D.

Exhibits

200-901 question #204 exhibit 1
200-901 question #204 exhibit 2
200-901 question #204 exhibit 3
200-901 question #204 exhibit 4

Options

  • Apayload = { } headers= { 'Authorization' : 'Basic GV2bmV0dXNlcjpDaXNj=', 'Content-Type' : 'application/json' }
  • Bpayload = { } headers= { 'Authorization' : 'Basic GV2bmV0dXNlcjpDaXNj=', 'Content-Type' : 'application/json' }
  • Cpayload = { } headers= { 'Authorization' : 'Bearer GV2bmV0dXNlcjpDaXNj=', 'Content-Type' : 'application/json' }
  • Dpayload = { } headers= { 'Authorization' : 'Bearer GV2bmV0dXNlcjpDaXNj=', 'Content-Type' : 'application/json' }

How the community answered

(15 responses)
  • B
    80% (12)
  • C
    13% (2)
  • D
    7% (1)

Explanation

HTTP Basic Authentication requires the Authorization header in the format: 'Basic <base64-encoded-credentials>'. The keyword 'Basic' signals to the server that the credential string is a Base64-encoded username:password pair. Options C and D use 'Bearer' instead of 'Basic' - Bearer is used for token-based authentication (e.g., OAuth 2.0 tokens), not Basic Auth. Options A and B both appear structurally identical in this question, but B is the intended correct answer representing proper Basic Auth syntax with the empty payload and the correct 'Basic' scheme.

Topics

#REST API#Basic Authentication#HTTP Headers#API Authentication

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice