From a0a5e70fc4daa884871d553faa27598966cb65e8 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 3 Jun 2019 10:04:00 +0000 Subject: [PATCH] httpclient : do not force the namespace for domframework git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5305 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- httpclient.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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")