Get the message from the response.

@param array $rawResponse

@return string|null
517548
protected function getMessage($rawResponse)
    {
        if ($message = Arr::get($rawResponse, 'message')) {
            return $message;
        }

        if (!empty(Arr::get($rawResponse, 'payments'))) {
            if ($message = $this->getPaymentStatus($rawResponse)) {
                return $message;
            }
        }
    }
97054
public function get_header($name, $raw = false)
    {
        if (empty($this->headers)) {
            return null;
        }

        return $this->headers->get($name, !$raw);
    }
183203
protected function getEmail( UserResponseInterface $response )
    {
        $responseArray = $response->getResponse();
        switch ( $response->getResourceOwner()->getName() )
        {
            case UserIdentity::getReadableType( UserIdentity::TYPE_TWITTER ):
                return NULL;
            case UserIdentity::getReadableType( UserIdentity::TYPE_YAHOO ):
                if ( array_key_exists( 'emails', $responseArray['profile'] ))
                {
                    if ( count( $responseArray['profile']['emails'] ) > 0 )
                    {
                        return $responseArray['profile']['emails'][0]['handle'];
                    }
                }
            default:
                if ( array_key_exists( 'email', $responseArray ))
                {
                    return $responseArray['email'];
                }
        }
    }
394717
public function getResponse($printResponse = true)
    {
        $this->setStatusInfo();
        if ($printResponse) {
            header('Content-Type: application/json');
            echo $this->ResponseData;
        } else {
            return $this->ResponseData;
        }
        return null;
    }
967072
protected function getHeaders(string $raw_headers) {
        // Normalize line breaks
        $raw_headers = str_replace("\r\n", "\n", $raw_headers);

        // There will be multiple headers if a 301 was followed
        // or a proxy was followed, etc
        $header_collection = explode("\n\n", trim($raw_headers));
        // We just want the last response (at the end)
        $raw_header = array_pop($header_collection);

        $header_components = explode("\n", $raw_header);
        $result = array();
        $http_status = 0;
        foreach ($header_components as $line) {
            if (strpos($line, ': ') === false) {
                $http_status = $this->getHttpStatus($line);
            } else {
                list($key, $value) = explode(': ', $line, 2);
                $result[$key] = $value;
            }
        }

        return array($http_status, $result);
    }
42809
private function parseHeader($rawHeader) {

        // Initialize the headers.
        $headers = [];
        $key     = "";

        // Handle each header.
        foreach (explode("\n", $rawHeader) as $h) {
            $h = explode(":", $h, 2);
            if (true === isset($h[1])) {
                if (false === isset($headers[$h[0]])) {
                    $headers[$h[0]] = trim($h[1]);
                } elseif (true === is_array($headers[$h[0]])) {
                    $headers[$h[0]] = array_merge($headers[$h[0]], [trim($h[1])]);
                } else {
                    $headers[$h[0]] = array_merge([$headers[$h[0]]], [trim($h[1])]);
                }
                $key = $h[0];
            } else {
                if ("\t" === substr($h[0], 0, 1)) {
                    $headers[$key] .= "\r\n\t" . trim($h[0]);
                } elseif (!$key) {
                    $headers[0] = trim($h[0]);
                }
                trim($h[0]);
            }
        }

        // Return the headers.
        return $headers;
    }
291978
protected function handleResponse($raw){
        $data = json_decode($raw,true);

        if(!empty($data["error"])){
            $reason = $data["error"]["errors"][0]["reason"];
            $msg    = $data["error"]["errors"][0]["message"];

            switch ($reason) {
                case 'keyInvalid':
                    throw new GoogleAuthException;
                    break;

                default:
                    throw new GoogleErrorException("Reason: {$reason}. Message: {$msg}.");
                    break;
            }
        }

        return $data;
    }
1273664
public function parse($rawBody, $contentType)
    {
        try {
            return Json::decode($rawBody, $this->asArray);
        } catch (\Exception $e) {
            if ($this->throwException) {
                throw new RequestException('Invalid JSON data in request body: ' . $e->getMessage(), [], $e);
            }

            return null;
        }
    }
151994
public static function getMessage($code)
    {
        return isset(self::$__messages[$code]) ? self::$__messages[$code] : null;
    }
574578
protected static function parseColumn(array $rawColumn, DataTablesWrapperInterface $wrapper) {

        if (false === static::isValidRawColumn($rawColumn)) {
            return null;
        }

        $dtColumn = $wrapper->getColumn($rawColumn[DataTablesColumnInterface::DATATABLES_PARAMETER_DATA]);
        if (null === $dtColumn) {
            return null;
        }
        if ($dtColumn->getName() !== $rawColumn[DataTablesColumnInterface::DATATABLES_PARAMETER_NAME]) {
            return null;
        }
        if (false === $dtColumn->getSearchable()) {
            $dtColumn->setSearch(static::parseSearch([])); // Set a default search.
            return $dtColumn;
        }

        $dtColumn->setSearch(static::parseSearch($rawColumn[DataTablesColumnInterface::DATATABLES_PARAMETER_SEARCH]));

        return $dtColumn;
    }
65946
public static function getMessageByCode($code)
    {
        return isset(self::$_httpCodes[$code]) ? self::$_httpCodes[$code] : null;
    }
1276692
protected function getTypedValue ($rawValue) {
		if (gettype($rawValue) == "array") {
			foreach ($rawValue as $key => $value) {
				$rawValue[$key] = $this->getTypedValue($value);
			}
			return $rawValue; // array
		} else if (mb_strlen($rawValue) > 0) {
			if (is_numeric($rawValue)) {
				return $this->getTypedValueFloatOrInt($rawValue);
			} else {
				return $this->getTypedSpecialValueOrString($rawValue);
			}
		} else {
			return $this->getTypedSpecialValueOrString($rawValue);
		}
	}
12727
public function getRawHeaders(): string
    {
        if (null === $this->rawHeaders) {
            $rawHeaders = \imap_fetchheader($this->resource->getStream(), $this->getNumber(), \FT_UID);

            if (false === $rawHeaders) {
                throw new ImapFetchheaderException('imap_fetchheader failed');
            }

            $this->rawHeaders = $rawHeaders;
        }

        return $this->rawHeaders;
    }
661357
private function parseHttpHeaders($rawHeaders) {
		// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
		$headers = array();
		$key = '';

		foreach (explode("\n", $rawHeaders) as $h) {
			$h = explode(':', $h, 2);

			if (isset($h[1])) {
				if (!isset($headers[$h[0]])) {
					$headers[$h[0]] = trim($h[1]);
				} elseif (is_array($headers[$h[0]])) {
					$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));
				} else {
					$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));
				}

				$key = $h[0];
			} else {
				if (substr($h[0], 0, 1) === "\t") {
					$headers[$key] .= "\r\n\t".trim($h[0]);
				} elseif (!$key) {
					$headers[0] = trim($h[0]);
				}
				trim($h[0]);
			}
		}

		return $headers;
	}
336250
protected function handleResponse($raw){
        $data = json_decode($raw,true);

        if(!isset($data['status_code'])){
            return $raw;
        }

        if($data['status_code']>=300 || $data['status_code']<200){
            switch ($data['status_txt']) {
                case 'RATE_LIMIT_EXCEEDED':
                    throw new BitlyRateLimitException;
                    break;

                case 'INVALID_LOGIN':
                    throw new BitlyAuthException;
                    break;

                default:
                    throw new BitlyErrorException($data['status_txt']);
                    break;
            }
        }
        return $data;
    }
476750
protected function parseHeaders($rawHeaders)
    {
        $headers = array();

        $lines = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $rawHeaders));
        foreach ($lines as $header) {
            if (preg_match('/([^:]+): (.+)/m', $header, $match)) {
                if (!isset($headers[$match[1]])) {
                    $headers[$match[1]] = trim($match[2]);
                } elseif (is_array($headers[$match[1]])) {
                    $headers[$match[1]][] = trim($match[2]);
                } else {
                    $headers[$match[1]] = array($headers[$match[1]], trim($match[2]));
                }
            }
        }

        return $headers;
    }
238517
public static function createFromRaw(string $rawResponse, string $responseClassName = Response::class): ResponseInterface
    {
        $response = new $responseClassName();

        if (!$response instanceof ResponseInterface) {
            throw new \InvalidArgumentException(sprintf('The given response class name "%s" does not implement the "%s" and cannot be created with this method.', $responseClassName, ResponseInterface::class));
        }

        // see https://tools.ietf.org/html/rfc7230#section-3.5
        $lines = explode(chr(10), $rawResponse);
        $statusLine = array_shift($lines);

        if (substr($statusLine, 0, 5) !== 'HTTP/') {
            throw new \InvalidArgumentException('The given raw HTTP message is not a valid response.', 1335175601);
        }
        list($httpAndVersion, $statusCode, $reasonPhrase) = explode(' ', $statusLine, 3);
        $version = explode('/', $httpAndVersion)[1];
        if (strlen($statusCode) !== 3) {
            // See https://tools.ietf.org/html/rfc7230#section-3.1.2
            throw new \InvalidArgumentException('The given raw HTTP message contains an invalid status code.', 1502981352);
        }
        $response = $response->withStatus((integer)$statusCode, trim($reasonPhrase));
        $response = $response->withProtocolVersion($version);

        $parsingHeader = true;
        $contentLines = [];
        $headers = new Headers();
        foreach ($lines as $line) {
            if ($parsingHeader) {
                if (trim($line) === '') {
                    $parsingHeader = false;
                    continue;
                }
                $headerSeparatorIndex = strpos($line, ':');
                if ($headerSeparatorIndex === false) {
                    throw new \InvalidArgumentException('The given raw HTTP message contains an invalid header.', 1502984804);
                }
                $fieldName = trim(substr($line, 0, $headerSeparatorIndex));
                $fieldValue = trim(substr($line, strlen($fieldName) + 1));
                if (strtoupper(substr($fieldName, 0, 10)) === 'SET-COOKIE') {
                    $cookie = Cookie::createFromRawSetCookieHeader($fieldValue);
                    if ($cookie !== null) {
                        $headers->setCookie($cookie);
                    }
                } else {
                    $headers->set($fieldName, $fieldValue, false);
                }
            } else {
                $contentLines[] = $line;
            }
        }
        if ($parsingHeader === true) {
            throw new \InvalidArgumentException('The given raw HTTP message contains no separating empty line between header and body.', 1502984823);
        }
        $content = implode(chr(10), $contentLines);

        $response->setHeaders($headers);
        $response = $response->withBody(ArgumentsHelper::createContentStreamFromString($content));

        return $response;
    }