Allow custom headers in XML-RPC request
|Reported by:||ericmann||Owned by:|
WordPress avails an override to the default IXR_Client object that uses its own WP_Http wrapper for making the request. The wrapper itself is pluggable, but there are no filters before the call to wp_remote_post that allow developers to intercept and modify the request.
As a result, sending custom headers with the request (like cookies) requires developers in turn override IXR_Client with their own implementation in order to add the custom data. One example, which specifically addresses sending cookies with the request, is https://gist.github.com/ericmann/5808805.
Instead, the built-in WP_HTTP_IXR_Client object should pass its header array through a WordPress filter before building the remote request. Developers can hook in to this filter to add their own custom headers - be they cookies, authentication, language, or whatever.