src/Net/HTTP/Response/Parser.php
public static function fromString( $string )
	{
#		$string		= trim( $string );
		$parts		= explode( "\r\n\r\n", $string );
		$response	= new Net_HTTP_Response;
		while( $part = array_shift( $parts ) )
		{
			$pattern	= '/^([A-Z]+)\/([0-9.]+) ([0-9]{3}) ?(.+)?/';
			if( !preg_match( $pattern, $part ) )
			{
				array_unshift( $parts, $part );
				break;
			}
			if( !$response->headers->getFields() )
				$response	= self::parseHeadersFromString( $part );
		};
		$body	= implode( "\r\n\r\n", $parts );

/*		$encodings	= $response->headers->getField( 'content-encoding' );
		while( $encoding = array_pop( $encodings ) )
		{
			$method	= $encoding->getValue();
			$body	= Net_HTTP_Response_Decompressor::decompressString( $body, $method );
		}*/
		$response->setBody( $body );
		return $response;
	}
public static function fromString( $string )
	{
#		$string		= trim( $string );
		$parts		= explode( "\r\n\r\n", $string );
		$response	= new Net_HTTP_Response;
		while( $part = array_shift( $parts ) )
		{
			$pattern	= '/^([A-Z]+)\/([0-9.]+) ([0-9]{3}) ?(.+)?/';
			if( !preg_match( $pattern, $part ) )
			{
				array_unshift( $parts, $part );
				break;
			}
			if( !$response->headers->getFields() )
				$response	= self::parseHeadersFromString( $part );
		};
		$body	= implode( "\r\n\r\n", $parts );

/*		$encodings	= $response->headers->getField( 'content-encoding' );
		while( $encoding = array_pop( $encodings ) )
		{
			$method	= $encoding->getValue();
			$body	= Net_HTTP_Response_Decompressor::decompressString( $body, $method );
		}*/
		$response->setBody( $body );
		return $response;
	}
public static function fromString ( $ string ) { #		$string		= trim( $string ); $ parts = explode ( "\r\n\r\n" , $ string ) ; $ response = new Net_HTTP_Response ; while ( $ part = array_shift ( $ parts ) ) { $ pattern = '/^([A-Z]+)\/([0-9.]+) ([0-9]{3}) ?(.+)?/' ; if ( ! preg_match ( $ pattern , $ part ) ) { array_unshift ( $ parts , $ part ) ; break ; } if ( ! $ response -> headers -> getFields ( ) ) $ response = self :: parseHeadersFromString ( $ part ) ; } ; $ body = implode ( "\r\n\r\n" , $ parts ) ; /*		$encodings	= $response->headers->getField( 'content-encoding' );
		while( $encoding = array_pop( $encodings ) )
		{
			$method	= $encoding->getValue();
			$body	= Net_HTTP_Response_Decompressor::decompressString( $body, $method );
		}*/ $ response -> setBody ( $ body ) ; return $ response ; }
Parses Response String and returns resulting Response Object.
@access		public
@param		string				$request	Request String
@return		Net_HTTP_Response	Response Object
Parses Response String and returns resulting Response Object .