From 0cbda8f8c018ad2f6483b5f3124bae9565e363af Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 7 Jun 2019 07:49:39 +0000 Subject: [PATCH] httpclient : allow to overwrite Content-Type with form data git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5326 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- httpclient.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/httpclient.php b/httpclient.php index ba334ec..dc17d53 100644 --- a/httpclient.php +++ b/httpclient.php @@ -596,7 +596,10 @@ class Httpclient } if ($this->method !== "GET" && ! empty ($this->formData)) { - $this->headersSent["Content-Type"] = "application/x-www-form-urlencoded"; +var_dump ($this->headersSent); + if (! key_exists ("Content-Type", $this->headersSent)) + $this->headersSent["Content-Type"] = + "application/x-www-form-urlencoded"; $len = 0; foreach ($this->formData as $key => $val) {