Index: includes/xmlrpc.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/xmlrpc.inc,v
retrieving revision 1.57
diff -u -p -r1.57 xmlrpc.inc
--- includes/xmlrpc.inc	4 May 2009 10:38:47 -0000	1.57
+++ includes/xmlrpc.inc	26 May 2009 15:03:06 -0000
@@ -423,6 +423,10 @@ function xmlrpc_base64_get_xml($xmlrpc_b
  *   An absolute URL of the XML-RPC endpoint.
  *     Example:
  *     http://www.example.com/xmlrpc.php
+ * @param $headers
+ *   An array of headers.
+ *     Example (for sites that require HTTP authentication):
+ *     array('Authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==')
  * @param ...
  *   For one request:
  *     The method name followed by a variable number of arguments to the method.
@@ -441,6 +445,7 @@ function xmlrpc_base64_get_xml($xmlrpc_b
 function xmlrpc() {
   $args = func_get_args();
   $url = array_shift($args);
+  $headers = array_shift($args);
   if (is_array($args[0])) {
     $method = 'system.multicall';
     $multicall_args = array();
@@ -454,7 +459,7 @@ function xmlrpc() {
   }
   $xmlrpc_request = xmlrpc_request($method, $args);
   $options = array(
-    'headers' => array('Content-Type' => 'text/xml'),
+    'headers' => $headers + array('Content-Type' => 'text/xml'),
     'method' => 'POST',
     'data' => $xmlrpc_request->xml,
   );
