PHP Class ScriptFUSION\Porter\Net\Http\HttpConnector

Enhanced error reporting is achieved by ignoring HTTP error codes in the wrapper, instead throwing HttpServerException which includes the body of the response in the error message.
Inheritance: extends ScriptFUSION\Porter\Connector\CachingConnector
Show file Open project: ScriptFUSION/Porter Class Usage Examples

Public Methods

Method Description
__construct ( HttpOptions $options = null )
fetchFreshData ( string $source, EncapsulatedOptions $options = null ) : string
getBaseUrl ( ) : string
getTries ( ) : integer Gets the maximum number of fetch attempts
setBaseUrl ( $baseUrl )
setTries ( integer $tries ) Sets the maximum number of fetch attempts.

Private Methods

Method Description
getOrCreateUrlBuilder ( )

Method Details

__construct() public method

public __construct ( HttpOptions $options = null )
$options HttpOptions

fetchFreshData() public method

public fetchFreshData ( string $source, EncapsulatedOptions $options = null ) : string
$source string Source.
$options ScriptFUSION\Porter\Options\EncapsulatedOptions Optional. Options.
return string Response.

getBaseUrl() public method

public getBaseUrl ( ) : string
return string

getTries() public method

Gets the maximum number of fetch attempts
public getTries ( ) : integer
return integer

setBaseUrl() public method

public setBaseUrl ( $baseUrl )
$baseUrl

setTries() public method

Sets the maximum number of fetch attempts.
public setTries ( integer $tries )
$tries integer Maximum fetch attempts.