Courseiva

200-901 Understanding and Using APIs Practice Question

A developer is testing a REST API with curl and receives a response body containing JSON. They want to confirm that the payload is JSON before parsing it in code. Which HTTP response header should they check?

⚠ Common exam trap

Watch out — candidates often confuse the request header Accept, which expresses what the client wants, with the response header Content-Type, which states what the server actually sent.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Content-Type

The Content-Type response header is the server's declaration of the media type of the returned body. When it is application/json, the developer can safely hand the body to a JSON parser; when it is something else, such as text/html for an error page, parsing as JSON would fail. Checking this header is a standard defensive step before decoding API responses.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    User-Agent

    Why it's wrong here

    User-Agent identifies the client software making the request and is sent by the client, not the server. It carries no information about the response payload, so checking it after a curl call tells the developer nothing about whether the returned body is JSON or some other format.

  • ✓

    Content-Type

    Why this is correct

    Content-Type is a representation header that the server sets to describe the media type of the response body, for example application/json. Checking it confirms the payload format before parsing, and a value like application/json; charset=utf-8 also indicates the character encoding, which matters when decoding the bytes.

  • ✗

    Accept

    Why it's wrong here

    Accept is a request header in which the client declares the media types it can handle. It is not sent by the server, so inspecting the response for Accept will not reveal the payload format. The developer should instead look at a header the server includes to describe what it actually returned.

  • ✗

    Content-Length

    Why it's wrong here

    Content-Length reports the size of the response body in bytes, which helps with reading or validating completeness but says nothing about the data format. A JSON payload and an XML payload of the same size would both have identical Content-Length values, so it cannot confirm that the body is JSON.

About these practice questions

One of 975 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.