Task #44712

Decouple Argument-Building in the HTTP-Request-Constructor

Added by Achim Fritz over 8 years ago. Updated over 8 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Http
Target version:
-
Start date:
2013-01-22
Due date:
% Done:

0%

Estimated time:
Sprint:
PHP Version:
Has patch:
No
Complexity:

Description

It should be possible to create a HTTP-Request-Object without reading all arguments in the Constructor, especially the body-arguments in a PUT/POST-Request from the input stream "php://input".

If I need a HTTP-Request-Object in my RequestHandler for decide if i can handle this Request, the Creation of the HTTP-Request-Object empties the input stream and every later created HTTP-Request-Object gets no body-arguments.

Perhaps the input stream can be read first, when accessing the Request-Arguments


Related issues

Related to TYPO3.Flow - Bug #45290: Body arguments should not be merged before property mapping takes placeClosedBastian Waidelich2013-02-082013-04-13

Actions
#1

Updated by Robert Lemke over 8 years ago

  • Status changed from New to Accepted

Yes, I agree – the arguments could be initialized more lazy

#2

Updated by Bastian Waidelich over 8 years ago

There's a related issue that is kind of a blocker for REST services currently:
Imagine a put request to http://localhost/products/<uuid> with a request body of

<product>
  <title>modified title</title>
</product>

This results in the GET arguments array('product' => '<uuid>')
and decoded body arguments array('product' => array('title' => 'modified title'))

While merging the arguments in Http\Request::buildUnifiedArguments() the UUID is overridden.

BTW: This works when using object routing because then the product title is transformed into array('__identity' => '<uuid>') which can be merged with the content arguments

Also available in: Atom PDF