*** This is absolutely a CCNA question. ***
When I last recertified (2020), this question was definitely in it.
At the time, I hovered between options 'c' and 'd'
Can't remember which one I ended up selecting...
Yeah it's covered under
"6.5 Describe characteristics of REST-based APIs (CRUD, HTTP verbs, and data encoding)"
It's absolutely not taught in any of the courses I've seen or in the OCG, though.
D. Accept: application/json
The "Accept" header is used by the client to indicate the media types that are acceptable for the response. In this case, "application/json" specifies that the client expects JSON data in the response.
why the other options are not:
Accept-Encoding: gzip. deflate: This header specifies the compression formats the client can accept for the response body, not the media type itself.
Accept-Patch: text/example; charset=utf-8: This header is used specifically for patching a resource and indicates the accepted media type for the patch data.
Content-Type: application/json; charset=utf-8: This header specifies the media type of the request body, not what the client expects in the response.
Accept and Content-type are both headers sent from a client(browser say) to a service.
Accept header is a way for a client to specify the media type of the response content it is expecting and Content-type is a way to specify the media type of request being sent from the client to the server.
Using liviuml link:
Content-Type: application/json
(Content-Type: Determines what kind of representation is desired on the server-side).
Accept: application/json
(Accept: Determines what kind of representation is desired on the client-side).
https://restfulapi.net/content-negotiation/#:~:text=desired%20on%20the-,client%2Dside,-%2C%20an%20HTTP%20header
Accept Header tells the API that it is expecting the response in the specified media type e.g. application/json or application/xml.
Accept: application/json
And Content-Type tells the API about the media type of the request being sent in the request body e.g. application/json.
Content-Type: application/json
The Accept header always indicates what kind of response from the server a client can accept. Content-type is about the content of the current request or response, depending on which kind of HTTP message it is applied.
Started reading and have to aggree with D now, it's about what the client sends to the server to tell to the server what content type it can understand and expects.
The Accept request HTTP header indicates which content types, expressed as MIME types, the client is able to understand.
The Content-Type representation header is used to indicate the original media type of the resource (prior to any content encoding applied for sending).
In responses, a Content-Type header provides the client with the actual content type of the returned content.
This section is not available anymore. Please use the main Exam Page.200-301 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.
guynetwork
Highly Voted 2 years, 7 months agoPaddyInNZ
1 year, 5 months ago[Removed]
1 year, 4 months agosplashy
Highly Voted 2 years, 8 months ago[Removed]
1 year, 10 months agoJoshua25
Most Recent 6 months, 2 weeks ago[Removed]
1 year, 1 month agoZeroK
1 year, 2 months agoCynthia2023
1 year, 9 months agodropspablo
1 year, 10 months ago[Removed]
1 year, 10 months agoliviuml
2 years agoStevenYung
1 year, 10 months agozamkljo
2 years, 1 month agorijstraket
2 years, 2 months agoPanda_man
2 years, 5 months agosplashy
2 years, 7 months agog_mindset
2 years, 8 months agoPhonon
2 years, 4 months ago