note 123604 deleted from soapclient.soapclient by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:51:37 +0000 |
| Subject: | note 123604 deleted from soapclient.soapclient by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218106@lists.php.net to get a copy of this message | ||
Note Submitter: psy at psyberware dot com
----
If you try to use a 'stream_context' option to set additional HTTP headers, you should be
aware of a couple of things.
First, even if you are using a https URL, the 'header' will be pulled from the
'http' section:
$context = stream_context_create([
'https' => [
'header' => 'Test: this will be ignored'
],
'http' => [
'header' => 'Test: this will be used'
]
]);
Second, there are a number of headers that are ignored, and will never be used. Check the underlying
C source file soap/php_http.c and search for "skip some predefined headers" for a list.
This is the reason some people report problems trying to set Host, Authorization, and other headers
in certain situations.