public function PeclHttpMessageParser::parseResponse

Parse an HTTP response message into an associative array of parts.

Parameters

string $message HTTP response to parse:

Return value

array|bool Returns false if the message is invalid

Overrides MessageParserInterface::parseResponse

File

drupal/core/vendor/guzzle/parser/Guzzle/Parser/Message/PeclHttpMessageParser.php, line 37

Class

PeclHttpMessageParser
Pecl HTTP message parser

Namespace

Guzzle\Parser\Message

Code

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,
  );
}