Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

XML · RESTCONF

Direct answer

RESTCONF XML encoding uses media type application/yang-data+xml, with namespaces from the YANG modules, matching what NETCONF uses.

When to use this

Use this when sending or reading RESTCONF data as XML with YANG namespaces.

First 30 seconds

1. RESTCONF XML uses module namespaces.

2. Same encoding as NETCONF data.

3. Parse safely.

4. Choose JSON or XML consistently.

5. Media type headers.

Operational verification

YANG → XML with namespaces

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
RESTCONF / YANG HTTP automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformRESTCONF / YANG HTTP automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when sending or reading RESTCONF data as XML with YANG namespaces.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as wrong resource URI, PUT/PATCH replacement semantics confusion, stale conditional requests, content-type mismatch and treating 2xx as state convergence, choosing the cases most relevant to XML syntax/namespace/encoding plus schema/consumer expectations; preserve qualified names and distinguish well-formedness from application validity.

Step 2 Common mistakes Narrow the fault
  • Wrong namespace URI, so the device ignores the data.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • application/yang-data+xml.
  • Namespaces from YANG modules.
  • Same as NETCONF payloads.
Key checks
  • curl ... -H 'Accept: application/yang-data+xml' | xmllint --format - — XML response
  • Namespaces per module — xmlns
  • Same structure as NETCONF content — reuse
ReferenceWhy it matters1 section · depth on demand

What it is

RESTCONF XML encoding uses application/yang-data+xml with XML namespaces from the YANG module.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

RESTCONF supports both JSON and XML encodings of YANG data, selected with the Accept and Content-Type headers. XML matches NETCONF and is convenient when reusing NETCONF payloads; JSON is easier in most scripting.

EncodingMedia type
JSONapplication/yang-data+json
XMLapplication/yang-data+xml
curl -s -u admin:pass -H 'Accept: application/yang-data+xml' \
  https://10.0.0.1/restconf/data/ietf-interfaces:interfaces

In XML, module namespaces are attributes (xmlns="urn:ietf:..."); in JSON they appear as prefixes on top-level names ("ietf-interfaces:interfaces"). Mixing them up is a common reason for 400 errors.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docRESTCONF / YANG HTTP automation current

Authoritative/upstream documentation reviewed for bounded claims in RESTCONF > XML. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For XML syntax/namespace/encoding plus schema/consumer expectations; preserve qualified names and distinguish well-formedness from application validity, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?