Courseiva

200-901 Understanding and Using APIs Practice Question

A developer is integrating a Python script with the Cisco Webex API. The script needs to read the value of the HTTP status code returned by the API to decide whether to retry a request. Using the requests library, which attribute of the response object should the developer inspect?

⚠ Common exam trap

The trap here is assuming that a boolean success indicator such as ok carries the same information as the numeric status code, when it collapses every failure into a single False.

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

✓

response.status_code

The requests library parses the HTTP status line of the server response and stores the numeric code in the status_code attribute. A client integrating with the Webex API reads that integer to detect conditions such as 401 for bad tokens or 429 for rate limiting, then decides whether to retry, refresh credentials, or fail. The boolean ok, the reason phrase, and header lookups do not provide the exact numeric value needed.

Answer analysis

Option-by-option breakdown

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

  • ✗

    response.headers['Status']

    Why it's wrong here

    HTTP status codes are transmitted on the status line, not as a header. While some servers add custom headers, there is no standard 'Status' response header, so this lookup would normally raise a KeyError. The requests library already parses the status line into status_code, making this approach both non-standard and unreliable for a Webex client.

  • ✗

    response.reason

    Why it's wrong here

    The reason attribute holds the human-readable reason phrase that accompanies the status line, such as 'Unauthorized' or 'Too Many Requests'. It is a descriptive string, not the numeric code, and its wording is not guaranteed to be stable across servers or proxies. Comparing strings would be fragile, so this attribute does not satisfy the requirement to read the code value.

  • ✓

    response.status_code

    Why this is correct

    The requests library exposes the numeric HTTP status code of the server's reply through the status_code attribute, so a script can compare it against values such as 200, 401, or 429 and branch its retry logic accordingly. This is the standard, documented way to read the code without parsing the raw message, making it the right choice for a Webex integration that must react to rate limiting or authentication failures.

  • ✗

    response.ok

    Why it's wrong here

    The ok attribute returns a boolean that is True for any status code below 400 and False otherwise. It never exposes the actual numeric code, so a script could not distinguish a 401 from a 429 or a 500. Because the scenario requires reading the exact value to decide whether and how to retry, this boolean is too coarse and therefore incorrect here.

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.