PHP Class PHPDaemon\Clients\HTTP\Connection

Author: Vasily Zorin ([email protected])
Inheritance: extends PHPDaemon\Network\ClientConnection
Datei anzeigen Open project: kakserpom/phpdaemon

Public Properties

Property Type Description
$body Contains response body
$charset
$chunkcb callback
$chunked boolean
$contentLength Content length
$contentType
$cookie Associative array of Cookies
$eofTerminated
$headers Associative array of headers
$lastURL Last requested URL
$protocolError integer
$rawHeaders Raw headers array
$reqType string
$responseCode integer

Protected Properties

Property Type Description
$EOL End of line
$curChunk string
$curChunkSize Size of current chunk
$requests SplStack

Public Methods

Method Description
get ( string $url, array $params = null ) Perform a GET request
getBody ( ) : string Get body
getHeader ( string $name ) : string Get header
getHeaders ( ) : array Get headers
head ( string $url, array $params = null ) Perform a HEAD request
onFinish ( ) Called when connection finishes
onRead ( ) Called when new data received
post ( string $url, array $data = [], array $params = null ) Perform a POST request

Protected Methods

Method Description
customRequestHeaders ( array $headers )
init ( ) Constructor
requestFinished ( ) Called when request is finished
sendRequestHeaders ( $type, $url, &$params ) : void Send request headers

Method Details

customRequestHeaders() protected method

protected customRequestHeaders ( array $headers )
$headers array

get() public method

Perform a GET request
public get ( string $url, array $params = null )
$url string
$params array

getBody() public method

Get body
public getBody ( ) : string
return string

getHeader() public method

Get header
public getHeader ( string $name ) : string
$name string Header name
return string

getHeaders() public method

Get headers
public getHeaders ( ) : array
return array

head() public method

Perform a HEAD request
public head ( string $url, array $params = null )
$url string
$params array

init() protected method

Constructor
protected init ( )

onFinish() public method

Called when connection finishes
public onFinish ( )

onRead() public method

Called when new data received
public onRead ( )

post() public method

Perform a POST request
public post ( string $url, array $data = [], array $params = null )
$url string
$data array
$params array

requestFinished() protected method

Called when request is finished
protected requestFinished ( )

sendRequestHeaders() protected method

Send request headers
protected sendRequestHeaders ( $type, $url, &$params ) : void
$type
$url
return void

Property Details

$EOL protected_oe property

End of line
protected $EOL

$body public_oe property

Contains response body
public $body

$charset public_oe property

public $charset

$chunkcb public_oe property

public callback $chunkcb
return callback

$chunked public_oe property

public bool $chunked
return boolean

$contentLength public_oe property

Content length
public $contentLength

$contentType public_oe property

public $contentType

$curChunk protected_oe property

protected string $curChunk
return string

$curChunkSize protected_oe property

Size of current chunk
protected $curChunkSize

$eofTerminated public_oe property

public $eofTerminated

$headers public_oe property

Associative array of headers
public $headers

$lastURL public_oe property

Last requested URL
public $lastURL

$protocolError public_oe property

public int $protocolError
return integer

$rawHeaders public_oe property

Raw headers array
public $rawHeaders

$reqType public_oe property

public string $reqType
return string

$requests protected_oe property

protected SplStack $requests
return SplStack

$responseCode public_oe property

public int $responseCode
return integer