Skip to content

SoapClient - constructor - stream_context - Info regarding headers being ignored is probably misleading #5636

Description

@AndreasA

Affected page

https://www.php.net/manual/en/soapclient.construct.php#soapclient.construct.options.stream-context

Current issue

The current part of stream_context in https://www.php.net/manual/en/soapclient.construct.php#soapclient.construct.options.stream-context

says:

Note that the following HTTP headers are generated automatically or from other options, and will be ignored if specified in the 'header' context option: host, connection, user-agent, content-length, content-type, cookie, authorization, and proxy-authorization

However, I think e.g. Authorization can actually be supplied according to src as long as the Authorization is not defined by the SoapClient.

Which would be good to know e.g. if the SOAP request requires an oauth2 bearer token or similar to work. That way it could be easily set using the stream_context, which could be remembered preior to forwarding, so the token can also be updated if needed.

Suggested improvement

Explitely state the scnearios when which header is ignored, as e.g. Authorzation is added I think as long as login is not defined.

Additional context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions