public static function parseBodyData(ResponseInterface $httpResponse)
    {
        $bodyText = (string)$httpResponse->getBody();

        // Split the bodyText into lines.

        $lines = preg_split('/[\n\r]+/', $bodyText);

        $responseData = [];

        foreach ($lines as $line) {
            $line = explode('=', $line, 2);

            if (! empty($line[0])) {
                $responseData[trim($line[0])] = isset($line[1]) ? trim($line[1]) : '';
            }
        }

        return $responseData;
    }
public static function parseBodyData(ResponseInterface $httpResponse)
    {
        $bodyText = (string)$httpResponse->getBody();

        // Split the bodyText into lines.

        $lines = preg_split('/[\n\r]+/', $bodyText);

        $responseData = [];

        foreach ($lines as $line) {
            $line = explode('=', $line, 2);

            if (! empty($line[0])) {
                $responseData[trim($line[0])] = isset($line[1]) ? trim($line[1]) : '';
            }
        }

        return $responseData;
    }
public static function parseBodyData ( ResponseInterface $ httpResponse ) { $ bodyText = ( string ) $ httpResponse -> getBody ( ) ; // Split the bodyText into lines. $ lines = preg_split ( '/[\n\r]+/' , $ bodyText ) ; $ responseData = [ ] ; foreach ( $ lines as $ line ) { $ line = explode ( '=' , $ line , 2 ) ; if ( ! empty ( $ line [ 0 ] ) ) { $ responseData [ trim ( $ line [ 0 ] ) ] = isset ( $ line [ 1 ] ) ? trim ( $ line [ 1 ] ) : '' ; } } return $ responseData ; }
The payload consists of name=>value pairs, each on a separate line.

@param ResponseInterface $httpResponse
@return array
The payload consists of name = > value pairs each on a separate line .