Courseiva

200-901 Understanding and Using APIs Practice Question

A developer is testing a REST API with curl and wants the response to include only the HTTP status code and response headers, discarding the body. Which curl option accomplishes this?

⚠ Common exam trap

Test-takers frequently confuse -o, which redirects the body to a file, with -I, which suppresses the body entirely by using the HEAD method.

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

✓

curl -I https://api.example.com/devices

The -I option issues a HEAD request, which asks the server for the same headers it would send for a GET but without the body. This is ideal for checking status codes, content types, and rate-limit headers cheaply. It is a safe, idempotent inspection method that avoids transferring large payloads during API testing.

Answer analysis

Option-by-option breakdown

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

  • ✗

    curl -o headers.txt https://api.example.com/devices

    Why it's wrong here

    The -o flag writes the response body to a file rather than displaying it, but it still downloads the body and does not restrict output to headers. The developer would not see the status and headers on the terminal, and the full body would be saved, which is not the intended outcome.

  • ✗

    curl -d @payload.json https://api.example.com/devices

    Why it's wrong here

    The -d flag sends data in the request body, usually implying a POST, and does not suppress the response body. This option both performs a write-like operation and returns full output, so it fails to meet the requirement of showing only status and headers.

  • ✗

    curl -X POST https://api.example.com/devices

    Why it's wrong here

    Using -X POST changes the HTTP method to POST, which typically creates or modifies a resource and returns a body. This does not limit output to headers and status; it also risks unintended side effects on the server because POST is not a safe, read-only method for inspection.

  • ✓

    curl -I https://api.example.com/devices

    Why this is correct

    The -I option sends a HEAD request, so the server returns headers and status without a response body. This matches the goal of seeing only the status code and headers. It is the standard curl way to inspect metadata such as content type, cache directives, or rate-limit fields without downloading the full representation.

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.