Parse an HTTP response message into an associative array of parts.
string $message HTTP response to parse:
array|bool Returns false if the message is invalid
Overrides MessageParserInterface::parseResponse
public function parseResponse($message) {
if (!$message) {
return false;
}
$parts = http_parse_message($message);
return array(
'protocol' => 'HTTP',
'version' => number_format($parts->httpVersion, 1),
'code' => $parts->responseCode,
'reason_phrase' => $parts->responseStatus,
'headers' => $parts->headers,
'body' => $parts->body,
);
}