A developer is writing an application that uses a REST API and the application requires a valid response from the API. Which element of the response is used in the conditional check?
The answer is status_code. The question asks about which element of the response is used, yeah the header is used but not as a whole, it uses the status_code which is inside of the header.
This one is tricky, if you think about it, by checking the response code you can know whether the request was successful or not. But in theory, all responses are valid, they're just a consequence of what you sent in the request. But not all responses are successful responses, that's different. On the other side, if your application is expecting a response to a GET request where data MUST be encoded in JSON but our server sends XML, then this response is not VALID for our application, because we don't support it.
Again, it is tricky but if we strictly follow the wording in this question, B makes more sense because we could check the content-type header and determine whether we accept or not this response.
B IS INCORRECT.
D (Status Code) is correct because it refers to the first line of the response, where you can check the principal response of the CRUD operation.
https://developer.cisco.com/learning/lab/what-are-rest-apis/step/1
Status Code I would believe...
Responses consist of the following elements:
The version of the HTTP protocol they follow.
A status code, indicating if the request was successful, or not, and why.
A status message, a non-authoritative short description of the status code.
HTTP headers, like those for requests.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
Suppose, status_code is right. I thought, maybe this question is about HTTP conditional request, but I then decided that it could not be so overcomplicating
I am not sure, but seems B is correct.
Because they are asking " element of the response"; i guess response header is an element (which will contain status code, and few other infos as well).
Again, not sure though ....
upvoted 1 times
...
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Requium
Highly Voted 4 years, 5 months agoionycash
3 years, 4 months agoCiscoRider
Highly Voted 4 years, 3 months agokymoni
Most Recent 7 months agoherrmann69
9 months, 1 week agoworking_on_hcip
1 year, 1 month agor3mo
1 year, 9 months agonebtashi
3 years, 6 months agoMedra76
3 years, 8 months agogeex
3 years, 9 months agouerdemk
3 years, 11 months agoCiscoTech
4 years, 2 months agopengyou
4 years, 4 months agoFireTv
4 years, 4 months ago