PHP Class HTTPConnection

Inheritance: extends CURLConnection
ファイルを表示 Open project: imastersdev/correios Class Usage Examples

Protected Properties

Property Type Description
$connectionTimeout integer
$cookieManager CookieManager
$hostname string
$httpAuthenticator HTTPAuthenticator
$initialized boolean
$port integer
$requestBody string
$requestHeader array
$requestParameter array
$secure boolean
$timeout integer
$userAgent string

Public Methods

Method Description
__construct ( )
addHeader ( string $name, string $value, boolean $override = true )
close ( )
execute ( string $path = '/', string $method = HTTPRequestMethod::GET ) : HTTPResponse
getConnectionTimeout ( ) : integer
getCookieManager ( ) : CookieManager
getHost ( ) : string
getHostName ( ) : string
getPort ( ) : integer
getTimeout ( ) : integer
getURI ( ) : string
initialize ( string $hostname, boolean $secure = false, integer $port = HTTPConnection::HTTP_PORT, integer $connectionTimeout, integer $timeout )
isSecure ( ) : boolean
newRequest ( ) : HTTPRequest
setAuthenticator ( HTTPAuthenticator $httpAuthenticator )
setConnectionTimeout ( integer $connectionTimeout )
setCookieManager ( CookieManager $cookieManager )
setParam ( string $name, string $value = null )
setRequestBody ( string $requestBody )
setTimeout ( integer $timeout )

Method Details

__construct() public method

public __construct ( )

addHeader() public method

public addHeader ( string $name, string $value, boolean $override = true )
$name string Nome do campo de cabeçalho.
$value string Valor do campo de cabeçalho.
$override boolean Indica se o campo deverá ser sobrescrito caso já tenha sido definido.

close() public method

public close ( )

execute() public method

public execute ( string $path = '/', string $method = HTTPRequestMethod::GET ) : HTTPResponse
$path string Caminho da requisição.
$method string Método da requisição.
return HTTPResponse Resposta HTTP.

getConnectionTimeout() public method

public getConnectionTimeout ( ) : integer
return integer

getCookieManager() public method

public getCookieManager ( ) : CookieManager
return CookieManager

getHost() public method

public getHost ( ) : string
return string

getHostName() public method

public getHostName ( ) : string
return string

getPort() public method

public getPort ( ) : integer
return integer

getTimeout() public method

public getTimeout ( ) : integer
return integer

getURI() public method

public getURI ( ) : string
return string

initialize() public method

public initialize ( string $hostname, boolean $secure = false, integer $port = HTTPConnection::HTTP_PORT, integer $connectionTimeout, integer $timeout )
$hostname string Servidor que receberá a requisição.
$secure boolean Indica se a conexão será segura (https).
$port integer Porta da requisição.
$connectionTimeout integer Timeout de conexão em segundos.
$timeout integer Timeout de espera em segundos.

isSecure() public method

public isSecure ( ) : boolean
return boolean

newRequest() public method

public newRequest ( ) : HTTPRequest
return HTTPRequest

setAuthenticator() public method

public setAuthenticator ( HTTPAuthenticator $httpAuthenticator )
$httpAuthenticator HTTPAuthenticator

setConnectionTimeout() public method

public setConnectionTimeout ( integer $connectionTimeout )
$connectionTimeout integer

setCookieManager() public method

public setCookieManager ( CookieManager $cookieManager )
$cookieManager CookieManager

setParam() public method

public setParam ( string $name, string $value = null )
$name string Nome do parâmetro.
$value string Valor do parâmetro.

setRequestBody() public method

public setRequestBody ( string $requestBody )
$requestBody string

setTimeout() public method

public setTimeout ( integer $timeout )
$timeout integer

Property Details

$connectionTimeout protected_oe property

protected int $connectionTimeout
return integer

$cookieManager protected_oe property

protected CookieManager $cookieManager
return CookieManager

$hostname protected_oe property

protected string $hostname
return string

$httpAuthenticator protected_oe property

protected HTTPAuthenticator $httpAuthenticator
return HTTPAuthenticator

$initialized protected_oe property

protected bool $initialized
return boolean

$port protected_oe property

protected int $port
return integer

$requestBody protected_oe property

protected string $requestBody
return string

$requestHeader protected_oe property

protected array $requestHeader
return array

$requestParameter protected_oe property

protected array $requestParameter
return array

$secure protected_oe property

protected bool $secure
return boolean

$timeout protected_oe property

protected int $timeout
return integer

$userAgent protected_oe static_oe property

protected static string $userAgent
return string