« Previous | Next » 

Revision 27853b9f

ID27853b9fdca4582f386b0299b0282172fcaf35d7
Parent 84f2966e
Child e51257c2, 2796a972

Added by Rens Admiraal over 7 years ago

[!!!][FEATURE] Flexible parsing of request body arguments

Parsing of body arguments (e.g. xml, json) currently takes place in
``Http\Request`` and is hard-coded there.

This change extracts the decoding of body arguments from the request
class to a TypeConverter that is invoked by the ActionRequest only
if accessed.

The TypeConverter is referred to via a new marker interface
``MediaTypeConverterInterface``. In order to extend the media type
conversion, this interface has to be implemented by a custom
TypeConverter and set as default implementation in Objects.yaml::

TYPO3\Flow\Property\TypeConverter\MediaTypeConverterInterface:
className: 'Some\Custom\MediaTypeConverter'

This change also deprecates ``Http\Request::createActionRequest()``
in favor of ``$actionRequest = new ActionRequest($httpRequest);``

This is a breaking change in the rare case that
``Http\Request::getArguments()`` is expected to contain the parsed
request body already.
If you require to access those body arguments either use/create
an ActionRequest instance or parse the body arguments manually,
for example by using the PropertyMapper.

Change-Id: I1d192231810757f38aecfc3f7dc520b118ee3feb
Resolves: #45293
Releases: master

  • added
  • modified
  • copied
  • renamed
  • deleted