php / php/doc-en

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

Open
#5,636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Extension: soap
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stream_context section on the affected SoapClient constructor page and inspect the referenced SoapClient source behavior for HTTP headers. Verify when Authorization and the other listed headers are ignored, then revise the note to state those scenarios explicitly. Done means the documentation accurately distinguishes headers supplied through stream_context from headers overridden by SoapClient options.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.