Question

Difficulty: MediumCharacteristics of REST-Based APIs (CRUD, HTTP Verbs, Data Formats)

A network monitoring application sends an HTTP GET request to a Cisco DNA Center REST API endpoint to retrieve device health metrics. The request header includes `Accept: application/json`. Which outcome occurs as a result of including this request header?

  1. The API controller returns the requested health metrics formatted as a JSON payload in the HTTP response.Answer
  2. B
    The API controller executes an HTTP POST operation to generate a new JSON data file on the network device.
  3. C
    The API controller requires the client to supply an encrypted JSON body within the HTTP GET request payload.
  4. D
    The API controller modifies existing XML configuration settings on the network controller to match JSON standards.

Answer

The API controller returns the requested health metrics formatted as a JSON payload in the HTTP response.
The `Accept` request header allows a client to specify the media type (such as `application/json`) it expects to receive in response from a REST API server. When the server processes the HTTP GET request, it formats the requested data payload as JSON before returning it to the client.

Step-by-Step Solution

1
Analyze the HTTP verb specified in the API call.
The request uses HTTP GET, which maps to the Read operation in CRUD.
HTTP GET is safe and idempotent, designed solely to fetch existing data without modifying server state.
2
Evaluate the function of the `Accept` HTTP header field.
The `Accept: application/json` header informs the server of the data format preferred by the client for the HTTP response body.
`Accept` governs response format expectations, whereas `Content-Type` specifies the format of the request payload body.
3
Synthesize the verb action and header context.
The controller processes the GET request and sends back the requested data encoded in JSON.
This behavior directly reflects standard REST API architecture conventions.

Key Concept

HTTP Headers and Data Formats in REST APIs
Rate this question