exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 12 discussion

Actual exam question from Cisco's 200-901
Question #: 12
Topic #: 1
[All 200-901 Questions]

When a Cisco IOS XE networking device is configured using RESTCONF, what is the default data-encoding method?

  • A. JSON
  • B. YAML
  • C. XML
  • D. x-form-encoding
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ThePokemonNuzlockingMaster
Highly Voted 3 years ago
They are correct, I just tried it against an IOS-EX device and XML was default: SHOW VERSION OUTPUT (cut down): CiscoCSR1000v16.12.1a-1#show ver Cisco IOS XE Software, Version 16.12.01a Cisco IOS Software [Gibraltar], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.12.1a, RELEASE SOFTWARE (fc2) DEFAULT CURL OUTPUT: curl -k https://192.168.2.48/restconf/ -u "admin:admin" <restconf xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <data/> <operations/> <yang-library-version>2016-06-21</yang-library-version> </restconf> CURL OUTPUT WHEN ACCEPT = JSON: curl -k https://192.168.2.48/restconf/ -u "admin:admin" -H "Accept: application/yang-data+json" {"ietf-restconf:restconf":{"data":{},"operations":{},"yang-library-version":"2016-06-21"}}
upvoted 5 times
...
aplicacion101
Most Recent 7 months, 3 weeks ago
Selected Answer: A
IOS-XE The following services are supported by the REST connector for IOS-XE. get API to send GET command to the device. Argument Description Default content_type Content type returned(xml or json) (optional) json post API to send POST command with optional payload to the device. Argument Description Default content_type Content type retorned(xml or json) (optional) json or xml Note: If the content_type option is not passed, the script will try to detect if the payload is XML, otherwise it will assume JSON. The content-type and accept headers will be set based on the detected payload or on the passed content-type. DEVAST BOOK There are two new media types defined for RESTCONF: application/yang.api+xml for XML-encoded payloads application/yang.api+json for JSON-encoded data https://pubhub.devnetcloud.com/media/rest-connector/docs/user_guide/services/iosxe.html#
upvoted 1 times
aplicacion101
2 years, 6 months ago
People who say XML have reason, I did the test with a router CRS1000v and got a XML. Simplely I obtained: <restconf xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <data/> <operations/> <yang-library-version>2016-06-21</yang-library-version> </restconf> But in the texts says JSON. In conclution change my position to XML as default.
upvoted 1 times
...
...
SR_Cisco
7 months, 3 weeks ago
Selected Answer: A
Should be Json based on below source code:https://www.netconfcentral.org/modules/netconfd-pro/2021-10-13/source/cooked/ leaf restconf-default-encoding { type enumeration { enum "json" { value 0; description "Use JSON message encoding as the default."; } enum "xml" { value 1; description "Use XML message encoding as the default."; } } default "json"; description "Specifies the default response encoding to use if the incoming request does not have an indication of preferred content type (e.g., no Content-Type header, no Accept header). ";
upvoted 1 times
...
nunyabeez
2 years, 3 months ago
Selected Answer: C
Yep. It's C. I just ran a simple cURL query on an IOS-XE device without any Accept headers and it returned XML. I had to add the Accept: application/yang-data+json header to get JSON.
upvoted 4 times
...
tony554556
2 years, 4 months ago
A The Cisco IOS XE REST API uses the HTTP request methods described in Table 1-2. Note All REST API requests and responses must be in JSON format. XML is not supported https://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/restapi/restapi/RESTAPIintro.pdf
upvoted 2 times
...
chris_edwards
2 years, 4 months ago
Selected Answer: A
When a Cisco IOS XE networking device is configured using RESTCONF (REpresentational State Transfer Configuration Protocol), the default data-encoding method is JavaScript Object Notation (JSON). JSON is a lightweight data interchange format that is easy to read and write and is commonly used in RESTful APIs. In addition to JSON, RESTCONF also supports the Extensible Markup Language (XML) as a data-encoding method. You can specify which data-encoding method to use by including the appropriate media type in the "Content-Type" header of the RESTCONF request. For example, to use JSON encoding, you would include the media type "application/yang-data+json" in the "Content-Type" header. To use XML encoding, you would include the media type "application/yang-data+xml" in the "Content-Type" header.
upvoted 1 times
...
mellohello
2 years, 6 months ago
Selected Answer: C
RESTCONF—Uses structured data (XML or JSON) and YANG to provide a REST-like APIs. https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/166/b_166_programmability_cg/restconf_prog_int.html#:~:text=RESTCONF%E2%80%94Uses%20structured%20data%20(XML%20or%20JSON)%20and%20YANG%20to%20provide%20a%20REST%2Dlike%20APIs
upvoted 2 times
...
concepcionz
2 years, 6 months ago
I'll go with C
upvoted 2 times
...
Engr_Aamir
2 years, 7 months ago
Selected Answer: C
.ust be C question is about restconfig not about restAPI... Some are confused between these with this question...
upvoted 2 times
...
macxsz
2 years, 8 months ago
Selected Answer: C
I just tested in the lab. If there is no Accept header, the output is in XML
upvoted 3 times
...
MMJa
2 years, 8 months ago
The answer is JSON. It is in page 4 in the link https://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/restapi/restapi/RESTAPIintro.pdf Cisco IOS XE REST API Request Methods The Cisco IOS XE REST API uses the HTTP request methods described in Table 1-2. Note All REST API requests and responses must be in JSON format. XML is not supported.
upvoted 1 times
...
art2dtwo
2 years, 9 months ago
Selected Answer: C
When you use RESTCONF talking about Cisco IOS-XE, the method data encoding must be XML, I think
upvoted 2 times
...
Need_to_pass
2 years, 10 months ago
Selected Answer: C
XML is the default but supports also JSON
upvoted 3 times
...
macxsz
2 years, 11 months ago
Selected Answer: C
Default is XML I think
upvoted 2 times
...
Jedifurby
3 years, 1 month ago
Selected Answer: A
The IOS-XE documentation “Cisco IOS-XE REST API Managment Reference Guide” states : “All REST API requests and responses must be in JSON format. XML is not supported.”
upvoted 3 times
macxsz
2 years, 8 months ago
That is for REST API. we are not using rest api, we are using restconf
upvoted 1 times
...
...
sackla
3 years, 10 months ago
Link referenced does not suggest that XML is the default encoding method. In fact, the first example shows JSON returned. RESTCONF on IOS XE supports both JSON and XML as data-encoding methods
upvoted 2 times
Daeh
3 years, 10 months ago
Default is XML. Try in curl.
upvoted 7 times
...
hottopic
3 years, 8 months ago
nothing states the default. The links below don't even state a default, just says XML or JSON. Another poor question for a poorly thought out exam.
upvoted 4 times
...
...
Tushu
3 years, 10 months ago
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago