Base Distribution - Work Package #45088: Improved REST support
More flexible parsing of body arguments
Parsing of body arguments (e.g. xml, json) currently takes place in Http\Request and is hard-coded there.
Besides from being a bit buggy (e.g. you currently have to specify two root nodes like <root><product><title>changed title</title></product></root> where a common REST request would expected to be just <title>changed title</title>) the behavior can't be influenced easily because it happens so early in the request handling.
Updated by Bastian Waidelich over 8 years ago
Also see Marco Falkenbergs comment on #37604:
Some additional thoughts...
Processing of request content¶
In case of RESTful webservices the processing of the request's content should be more advanced and extensible. For now i.e. XML data is poorly treated by just converting over a SimpleXMLElement to an array. I know that this lack is mentioned by Robert in the comment, but there is no according issue tracker.
The funny thing is we have everything to make this work, because we have the property mapper with its type converters and their customizable configurations. Why don't allow IANA types AND class types as source types for a type converter? It's just pulling the responsibility for the property mapper one level up. Then you can implement the handling of XML data with your own XML type converter that i.e. accepts the source types 'application/xml', 'DOMNode', 'DOMElement', 'DOMDocument', 'DOMText'.
I tried it out and it works!