ResponseInformationHelper
abstract class ResponseInformationHelper (View source)
Helper to extract various information from PSR-7 responses.
Methods
Creates a response from the given raw, that is plain text, HTTP response.
Returns the human-readable message for the given status code.
Return the Request-Line of this Request Message, consisting of the method, the URI and the HTTP version Would be, for example, "GET /foo?bar=baz HTTP/1.1" Note that the URI part is, at the moment, only possible in the form "abs_path" since the actual requestUri of the Request cannot be determined during the creation of the Request.
Prepare array of header lines for this response
Analyzes this response, considering the given request and makes additions or removes certain headers in order to make the response compliant to RFC 2616 and related standards.
Details
static ResponseInterface
createFromRaw(string $rawResponse)
Creates a response from the given raw, that is plain text, HTTP response.
static string
getStatusMessageByCode(int $statusCode)
Returns the human-readable message for the given status code.
static string
generateStatusLine(ResponseInterface $response)
Return the Request-Line of this Request Message, consisting of the method, the URI and the HTTP version Would be, for example, "GET /foo?bar=baz HTTP/1.1" Note that the URI part is, at the moment, only possible in the form "abs_path" since the actual requestUri of the Request cannot be determined during the creation of the Request.
static array
prepareHeaders(ResponseInterface $response)
Prepare array of header lines for this response
static ResponseInterface
makeStandardsCompliant(ResponseInterface $response, RequestInterface $request)
Analyzes this response, considering the given request and makes additions or removes certain headers in order to make the response compliant to RFC 2616 and related standards.
It is recommended to call this method before the response is sent and Flow does so by default in its built-in HTTP request handler.