Courseiva

200-901 Understanding and Using APIs Practice Question

A network engineer is using curl to test a REST API endpoint on a Cisco IOS XE device that supports RESTCONF. The engineer wants to retrieve the configuration of the GigabitEthernet1 interface. Which curl command correctly sends a GET request to the RESTCONF API with the appropriate headers to retrieve the interface configuration in JSON format?

⚠ Common exam trap

Candidates often confuse the Accept header with Content-Type, or using the wrong HTTP method for retrieval.

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 -X GET -H 'Accept: application/yang-data+json' 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'

To retrieve data via RESTCONF, a GET request must be sent with the Accept header set to 'application/yang-data+json' to request JSON-formatted YANG data. The URL must correctly reference the data node using the module name and interface name. The other options use incorrect headers or HTTP methods.

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 -X POST -H 'Accept: application/yang-data+json' 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'

    Why it's wrong here

    This command uses POST instead of GET. POST is used to create or modify resources, not to retrieve them. For retrieving configuration, GET is the correct method. Using POST on this endpoint would likely result in an error or unintended modification.

  • ✗

    curl -X GET -H 'Accept: application/json' 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'

    Why it's wrong here

    While 'application/json' is a valid media type, RESTCONF specifically uses 'application/yang-data+json' to indicate YANG-modeled data in JSON. Using 'application/json' may not be supported by all RESTCONF implementations, and the server might return a 406 Not Acceptable error or default to XML.

  • ✓

    curl -X GET -H 'Accept: application/yang-data+json' 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'

    Why this is correct

    This command uses the correct HTTP method (GET) and sets the Accept header to 'application/yang-data+json', which tells the RESTCONF server to return the data in JSON format according to the YANG data model. The URL path correctly targets the specific interface using the ietf-interfaces module.

  • ✗

    curl -X GET -H 'Content-Type: application/yang-data+json' 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1'

    Why it's wrong here

    This command sets the Content-Type header instead of Accept. Content-Type describes the format of the request body, which is not used in a GET request. For a GET, the Accept header is used to specify the desired response format. Without the correct Accept header, the server might return XML or an error.

About these practice questions

Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.