Exam 350-401 All QuestionsBrowse all questions from this exam
Question 319

Refer to the exhibit. An engineer is using XML in an application to send information to a RESTCONF-enabled device. After sending the request, the engineer gets this response message and an HTTP response code of 400. What do these responses tell the engineer?

    Correct Answer: C

    The HTTP response code of 400 indicates a bad request, which usually means there is an issue with the request sent to the server. In this case, the error message specifically states 'End-of-file reached in XML stream' along with an 'error-tag' of 'malformed-message'. This indicates that the server expected the request body in XML format, but it was improperly formed or incomplete. The presence of 'application/xml' in the error response suggests that the Content-Type header of the request was set to 'application/xml'. Therefore, the problem lies with the structure or completeness of the XML data sent, making the correct answer that the Content-Type header sent was 'application/xml'.

Discussion
juliok33pOption: A

A is Correct Accept and Content-type are both headers sent from a client (a browser) to a service. Accept header is a way for a client to specify the media type of the response content it is expecting and Content-type is a way to specify the media type of request being sent from the client to the server. The response was sent in XML so we can say the Accept header sent was application/xml.

networkispowerOption: A

Correct answer is A. Tested using Postman. When using application/xml on the Accept Header (HTTP 400 Bad Request): { "errors": { "error": [ { "error-message": "mismatched keypaths: /interface , /if:interfaces", "error-path": "/ietf-interfaces:interfaces", "error-tag": "malformed-message", "error-type": "application" } ] } } When using application/xml on the Content-Type Header (HTTP 415 Unsupported Media Type): { "errors": { "error": [ { "error-message": "Unsupported media type: application/xml ; Should be one of: application/yang-data+xml, application/yang-data+json.", "error-tag": "malformed-message", "error-type": "application" } ] } }

Zizu007Option: D

D - Correct; when using Accept and Content-Type : application/yang-data+xml and Body content is JSON: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-message>End-of-file reached in XML stream</error-message> <error-path>/ietf-interfaces:interfaces</error-path> <error-tag>malformed-message</error-tag> <error-type>application</error-type> </error> </errors> when using Accept and Content-Type : application/yang-data+xml and Body content is XML: Status: 201

Zizu007

C - Wrong, same as A. when using Content-Type: 'application/xml' you will get this error: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-message>Unsupported media type: application/xml ; Should be one of: application/yang-data+xml, application/yang-data+json.</error-message> <error-tag>malformed-message</error-tag> <error-type>application</error-type> </error> </errors> -----------------------------------------------------------------

Zizu007

A - Wong; don't get confused between application/xml and application/yang-data+xml. when using Accept: 'application/xml' you will get this error: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> <error> <error-message>No acceptable mime-type supported. Got: application/xml ; Should be one of: application/yang-data+xml, application/yang-data+json, application/vnd.yang.collection+xml, application/vnd.yang.collection+json, application/yang-patch+xml, application/yang-patch+json.</error-message> <error-tag>invalid-value</error-tag> <error-type>application</error-type> </error> </errors> -----------------------------------------------------------------

Zizu007

when using Accept and Content-Type : application/yang-data+xml and Body content is XML: Status: 201

DarudeOption: C

Correct answer is C problem here is that the path of the interface isn't correct but there is no answer for that. Look at the atached link. there are two examples search for "3.6.3. Encoding Operation Resource Errors" there are two examples of error message one in Content-type in xml and other Content-type in json the result match the error message Content-type in xml LINK: https://datatracker.ietf.org/doc/html/draft-ietf-netconf-restconf-14#section-3.6.3

dnjJ56Option: C

The errors says " End of Life for XML stream' and it also says ' malformed message'. That means, the format of the data inside the request, which seems to be XML based on the error, is not compatible with what server expects. We define the format of the data inside the request using the Content-Type header (not by the Accept header). So I go with C.

[Removed]Option: C

Check the first line. It's saying xml but requstion yang-restconf

winderOption: A

Guys, if you want to share your answer, make sure give "Chosen Answer" option to help others. Thanks

SeMo0o0oOption: C

C is correct The error message indicates "End-of-file reached in XML stream": means that the XML data sent was incomplete or improperly closed. The error tag "malformed-message": means that the problem lies with the structure or content of the XML sent. I think A is incorrect, because if there was an issue with the Accept header, the error would likely indicate a problem with the response format, not the request body. The error message here specifically indicates an issue with the XML stream being sent, not with receiving data. - Content-Type Header: Specifies the format of the data being sent in the body of the request (e.g., application/xml for XML data).´ - Accept Header: Specifies the format of the response the client can handle (e.g., application/xml for XML responses).

cy111Option: C

Given that the issue is related to an improperly formatted XML body in the request and considering the options provided, the correct answer would be related to the Content-Type header. A. The Accept header sent was application/xml: This option is incorrect because the Accept header specifies what media types the client is willing to receive, not what was sent. B. POST was used instead of PUT to update: This is incorrect because the HTTP method used is not indicated as the problem here. C. The Content-Type header sent was application/xml: This is the most appropriate answer. The error message and the HTTP 400 response code indicate that the request was expected to be in XML format (as indicated by the Content-Type header), but the XML was malformed. D. A JSON body was used: This is incorrect because the error message specifically refers to an XML stream, not JSON.

mahnazmohamz

help im so confused

HungarianDishOption: D

Could someone research this topic please? "using XML in an application to send information" => Does this mean using "Content-Type: application/xml"? If yes, then JSON body would cause HTTP 400 error. Thus, I would go for D) "A JSON body was used." https://csod.my.site.com/supportcentral/s/article/How-do-I-resolve-HTTP-400-Bad-Request-errors-returned-by-Cornerstone-s-APIs?language=en_US "Verify that the Content-Type request header matches the raw body data type. Example: If your raw request body data is in JSON, but the Content-Type request header value contains "application/xml", you will encounter an HTTP 400 error." Plus: https://reqbin.com/req/3mrxjgw4/post-xml-example https://reqbin.com/req/abghm4zf/json-content-type

WookerOption: A

the correct answer is A.

snowfoxOption: C

So, the answer is C? So, Accept header sent was NOT application/xml. But, The Content-Type header sent was application/xml. So the system showed an error message because contect was application/xml?

TannhausOption: A

I think it's A

Jared28Option: B

As per the practice exam in: CCNP: ENCOR: 350-401: CCNP ENTERPRISE: Cisco Certified Network Professional: Implementing and Operating Cisco Enterprise Network Core Technologies (ENCOR)

bara_kenOption: A

This is A

Carl1999Option: B

B is corrrect. guess why 400 badrequest.