Add http\Client::setDebug(callable $debug) and constants
Returns:
* http\Client, self
Params:
* callable $debug as
function(http\Client $c, http\Client\Request $r, int $type, string $data)
Added constants (used for the $type bitmask parameter of the callback):
* http\Client::DEBUG_INFO (informational text)
* http\Client::DEBUG_IN (received data)
* http\Client::DEBUG_OUT (sent data)
* http\Client::DEBUG_HEADER (headers)
* http\Client::DEBUG_BODY (body)
* http\Client::DEBUG_SSL (SSL data)
E.g. incoming headers would have the bitmask
(http\Client::DEBUG_IN|http\Client::DEBUG_HEADER) set in the $type
parameter.
Messages of type http\Client::DEBUG_INFO contain human readable text
like "Proxy CONNECT connection closed\n".