ResponseData

FinalYes

This class is used to collect response data such as protocol version, status code, reason phrase and headers to be able to set them in the response object later. The methods of the class are intentionally inspired by the PSR-7 Psr\Http\Message\ResponseInterface.

Note this data attribute has been created since central FE rendering related services like ContentObjectRenderer can not deal with "additional" content data such as HTTP headers or assets from content elements. The goal is to make ContentObjectRenderer and other parts of the framework aware of this in the future. This will obsolete or at least change this attribute again.

Internal

Strictly internal! This is likely to at least change or vanish again.

Table of Contents

Methods

getHeaders()  : array<string|int, mixed>
getProtocolVersion()  : string
getReasonPhrase()  : string
getStatusCode()  : int
setHeader()  : void
setProtocolVersion()  : void
setReasonPhrase()  : void
setStatusCode()  : void

Methods

getHeaders()

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProtocolVersion()

public getProtocolVersion() : string
Tags
todo:

This should not exist at all! It is job of the web server and not of the application to add a proper HTTP version identifier. Remove as soon as extbase bootstrap does not handle this anymore, application should not change this!

Return values
string

getReasonPhrase()

public getReasonPhrase() : string
Tags
todo:

Follows getStatusCode(), should be adapted as well.

Return values
string

getStatusCode()

public getStatusCode() : int
Tags
todo:

This only exists for extbase b/w compat, see extbase bootstrap: In general, plugin like extbase should always throw PropagateResponseException to stop rendering in case of 3xx or 4xx. We should break this part in TYPO3 v15 by removing the handling from extbase bootstrap, and communicate that content elements which create non-200 should throw. PropagateResponseException should then be made non-internal.

Return values
int

setHeader()

public setHeader(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

setProtocolVersion()

public setProtocolVersion(string $protocolVersion) : void
Parameters
$protocolVersion : string

setReasonPhrase()

public setReasonPhrase(string $reasonPhrase) : void
Parameters
$reasonPhrase : string

setStatusCode()

public setStatusCode(int $statusCode) : void
Parameters
$statusCode : int

        
On this page

Search results