PHP Class PicoFeed\Client\Stream

Author: Frederic Guillot
Inheritance: extends PicoFeed\Client\Client
Show file Open project: fguillot/picofeed Class Usage Examples

Public Methods

Method Description
decodeBody ( string $body, PicoFeed\Client\HttpHeaders $headers ) : string Decode body response according to the HTTP headers.
decodeChunked ( string $str ) : string Decode a chunked body.
doRequest ( ) : array Do the HTTP request.

Private Methods

Method Description
prepareContext ( ) : array Prepare stream context.
prepareHeaders ( ) : string[] Prepare HTTP headers.
setEffectiveUrl ( array $headers ) Construct the final URL from location headers.

Method Details

decodeBody() public method

Decode body response according to the HTTP headers.
public decodeBody ( string $body, PicoFeed\Client\HttpHeaders $headers ) : string
$body string Raw body
$headers PicoFeed\Client\HttpHeaders HTTP headers
return string

decodeChunked() public method

Decode a chunked body.
public decodeChunked ( string $str ) : string
$str string Raw body
return string Decoded body

doRequest() public method

Do the HTTP request.
public doRequest ( ) : array
return array HTTP response ['body' => ..., 'status' => ..., 'headers' => ...]