PHPDaemon\Clients\HTTP\Examples\SimpleRequest::init PHP Method

init() public method

Constructor
public init ( ) : void
return void
    public function init()
    {
        try {
            $this->header('Content-Type: text/html');
        } catch (\Exception $e) {
        }
        $this->appInstance->httpclient->get('http://www.google.com/robots.txt', function ($conn, $success) {
            echo $conn->body;
            $this->finish();
        });
        // setting timeout
        $this->sleep(5, true);
    }
SimpleRequest