During the work for Wikibase - Federated Properties, a MwHttpRequestToResponseInterfaceAdapter was introduced with the following reasoning
MWHttpRequest contains response information after calling execute on it. Using ResponseInterface for passing response data around gives us better compatibility with 3rd party libraries such as Guzzle and also improves the request/response ambiguity of MWHttpRequest.
Upstreaming this to MediaWiki would
- eliminate the only direct binding to guzzle in wikibase production code (cf. T263381)
- allow for this handy capability to be used by others
Alternative (to the simple moving the adapter) approach leading to the same end result (binding to PSR standard not a particular third party library) are considered equally valid in the scope of this task (e.g. making MwHttpRequest implement PSR 7 interfaces)
Tech notes
- This could be introduced into core with a @unstable tag or similar for one release.
- This would immediately allow us to move the code there without blocking on getting it "perfect"