Task #63643

Story #63642: Introduce Request/Response model for frontend rendering

Use Request Response model in JsonView

Added by Helmut Hummel almost 6 years ago. Updated about 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-12-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Epic #92512: PSR-7 Request/Response handling in ExtbaseNew2020-10-08

Actions
#1

Updated by Mathias Schreiber almost 3 years ago

do you mean PSR7 responses here?

#2

Updated by Helmut Hummel almost 3 years ago

at the time of writing, there was no psr7 yet.
But yes, a response object might be based on
psr7 nowadays.

Point is to not directly send headers in the view object,
but add the headers to any type of response object instead.

#3

Updated by Mathias Brodala over 2 years ago

  • Sprint Focus set to On Location Sprint
#4

Updated by Mathias Brodala over 2 years ago

  • Sprint Focus deleted (On Location Sprint)

Not doing this now since PSR-7 request/response is vastly different from Extbase request/response.

#5

Updated by Christian Eßl 9 months ago

  • Category set to Extbase
#6

Updated by Alexander Schnitzler about 2 months ago

Making JsonView use Request/Response is not that easily possible without changing the ViewInterface in general since method render() must return a string. Still, this bug report is totally valid and must be addressed. My idea is as follows:

Make every action return a ResponseInterface and make the user do something like this:

$response = new Response($this->view->render());
$response->setHeader('Content-Type', 'application/json');

Unfortunately we need people to set headers manually outside the JsonView or we let them use the core JsonResponse which does the job for them. But setting headers in the view is a no go indeed.

#7

Updated by Alexander Schnitzler about 2 months ago

  • Related to Epic #92512: PSR-7 Request/Response handling in Extbase added

Also available in: Atom PDF