200-901 · Question #180
Refer to the exhibit. An API call is constructed to retrieve the inventory in XML formal by using the API. The response to the call is 401 Unauthorized. Which two headers must he added to the API…
The correct answer is D. Accept: application/xml E. Authorization: Bearer dXNlcm5hbWU6cGFzc3dvemQ=. A 401 Unauthorized response means the request lacks valid authentication credentials, and since the goal is to receive XML, the Accept header must also be set. Option E (Authorization: Bearer dXNlcm5hbWU6cGFzc3dvemQ=) is the correct HTTP header name and format for passing a…
Question
Refer to the exhibit. An API call is constructed to retrieve the inventory in XML formal by using the API. The response to the call is 401 Unauthorized. Which two headers must he added to the API call? (Choose two.)
Exhibit
Options
- ABearer-Token: dXNlcm5hbWU6cGFzc3dvemQ=
- BContent-Type: application/xml
- CAuthentication: Bearer dXNlcm5hbWU6cGFzc3dvemQ=
- DAccept: application/xml
- EAuthorization: Bearer dXNlcm5hbWU6cGFzc3dvemQ=
How the community answered
(38 responses)- A3% (1)
- B5% (2)
- C3% (1)
- D89% (34)
Explanation
A 401 Unauthorized response means the request lacks valid authentication credentials, and since the goal is to receive XML, the Accept header must also be set. Option E (Authorization: Bearer dXNlcm5hbWU6cGFzc3dvemQ=) is the correct HTTP header name and format for passing a Bearer token - 'Authorization' is the standard header defined in RFC 7235. Option D (Accept: application/xml) tells the server to respond with XML-formatted data, matching the stated requirement. Option A uses a non-standard header name 'Bearer-Token'. Option C uses 'Authentication' which is not a valid HTTP header (the correct name is 'Authorization'). Option B (Content-Type: application/xml) describes the format of the request body, not what format the response should be in - irrelevant for a GET/retrieval call.
Topics
Community Discussion
No community discussion yet for this question.
