I'm not 100% sure if this is RFC compliant but I think the logic would be valid:
Restconf could default to always return data with yang-data+json.
Unless the client sends "Accept: yang-data+xml" and nothing else. In this case, restconf would send the reply in xml.
bascically:
| Client Accept Header |
What restconf returns |
| yang-data+json |
yang-data+json |
| yang-data+json and yang-data+xml |
yang-data+json |
| yang-data+xml |
yang-data+xml |
| something else |
415 ? |
So the logic is only based on the Accept header and not on the Content-Type.
I'm not 100% sure if this is RFC compliant but I think the logic would be valid:
Restconf could default to always return data with yang-data+json.
Unless the client sends "Accept: yang-data+xml" and nothing else. In this case, restconf would send the reply in xml.
bascically:
So the logic is only based on the Accept header and not on the Content-Type.