Class AsyncHttp
The AsyncHttp class provides means to make HTTP and HTTPS requests.
This class should not be instanced as it is, but instead Http class's get() or post() method should be used to create instance of the AsyncHttp class.
public
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
public
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
private
|
|
public
|
|
public
|
|
public
|
#
withCallback( callable $callback, mixed $data = null )
Defines a callback which will be called later on when the remote server has responded or an error has occurred. |
public
|
|
public
mixed
|
#
waitAndReturnResponse( )
Waits until response is fully received from remote server and returns the response. Note that this blocks execution, but does not freeze the bot as the execution will return to event loop while waiting. |
public
|
$setting
|
|
public
|
$socketManager
|
|
public
|
$timer
|
|
public
|
$logger
|
|
private
|
$uri
|
|
private
|
$callback
|
|
private
|
$data
|
|
private
array
|
$headers
|
#
array()
|
private
|
$timeout
|
#
null
|
private
array
|
$queryParams
|
#
array()
|
private
|
$stream
|
|
private
|
$notifier
|
|
private
string
|
$requestData
|
#
''
|
private
string
|
$responseData
|
#
''
|
private
boolean
|
$headersEndPos
|
#
false
|
private
array
|
$responseHeaders
|
#
array()
|
private
|
$request
|
|
private
boolean
|
$errorString
|
#
false
|
private
|
$timeoutEvent
|
#
null
|
private
|
$finished
|
|
private
|
$loop
|