diff --git a/httpclient.php b/httpclient.php index 4a4a2be..e0c39a6 100644 --- a/httpclient.php +++ b/httpclient.php @@ -429,6 +429,19 @@ class Httpclient } // }}} + /** Set the authentication in Basic type + * @param string $login The login to use + * @param string $password The password to use + */ + public function authBasic ($login, $password) + // {{{ + { + $this->headersSent["Authorization"] = "Basic ". + base64_encode ("$login:$password"); + return $this; + } + // }}} + ////////////////////////////////// //// THE ACTIVE METHODS //// ////////////////////////////////// @@ -584,8 +597,7 @@ class Httpclient // {{{ if ($this->tcpclient === null) { - $this->tcpclient = new \vendor\domframework\tcpclient ($parseURL["host"], - $this->port); + $this->tcpclient = new tcpclient ($parseURL["host"], $this->port); $this->tcpclient->timeout ($this->timeout); $this->tcpclient->connect (); if ($parseURL["scheme"] === "https")